Skip to content

Commit

Permalink
#1 Add guides
Browse files Browse the repository at this point in the history
  • Loading branch information
kospiotr committed Jan 24, 2018
1 parent 61d97d4 commit 157131a
Show file tree
Hide file tree
Showing 12 changed files with 1,887 additions and 530 deletions.
2,328 changes: 1,805 additions & 523 deletions packages/site/package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@compodoc/compodoc": "^1.0.5",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"@types/node": "^6.0.96",
"codelyzer": "^4.0.1",
"gh-pages": "^1.1.0",
"jasmine-core": "~2.6.2",
Expand All @@ -60,7 +60,11 @@
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"markdown-loader": "^2.0.2",
"prism-hightlight-loader": "^0.1.1",
"prismjs-loader": "0.0.4",
"protractor": "~5.1.2",
"raw-loader": "^0.5.1",
"replace": "^0.3.0",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
Expand Down
7 changes: 6 additions & 1 deletion packages/site/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';

const routes: Routes = [];
const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'home', component: HomeComponent },
{ path: 'guide', loadChildren: './guides/guides.module#GuidesModule' }
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
Expand Down
9 changes: 6 additions & 3 deletions packages/site/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<rapid-core-sample>testing</rapid-core-sample>
<rapid-form></rapid-form>
<rapid-crud></rapid-crud>
<!--<rapid-core-sample>testing</rapid-core-sample>-->
<!--<rapid-form></rapid-form>-->
<!--<rapid-crud></rapid-crud>-->
<a routerLink="/home">Home</a>
<a routerLink="/guide">Guides</a>

<router-outlet></router-outlet>
4 changes: 3 additions & 1 deletion packages/site/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import {AppComponent} from './app.component';
import {SampleModule} from '@ngx-rapid/core';
import {FormModule} from '@ngx-rapid/form';
import {CrudModule} from '@ngx-rapid/crud';
import { HomeComponent } from './home/home.component';

@NgModule({
declarations: [
AppComponent
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
Expand Down
18 changes: 18 additions & 0 deletions packages/site/src/app/guides/guides.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
selector: 'app-guides',
template: `
<div class="container">
<div *ngIf="route.params | async as params" [innerHtml]="contents[params.id]"></div>
</div>
`,
})
export class GuidesComponent {
contents = {
'getting-started': require('!!raw-loader!prism-hightlight-loader!markdown-loader!./../../../../../README.md'),
};

constructor(public route: ActivatedRoute) {}
}
19 changes: 19 additions & 0 deletions packages/site/src/app/guides/guides.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

import { GuidesComponent } from './guides.component';

@NgModule({
imports: [
CommonModule,
RouterModule.forChild([
{ path: '', pathMatch: 'full', redirectTo: 'getting-started' },
{ path: ':id', component: GuidesComponent },
]),
],
declarations: [
GuidesComponent,
],
})
export class GuidesModule { }
3 changes: 3 additions & 0 deletions packages/site/src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>
home works!
</p>
Empty file.
15 changes: 15 additions & 0 deletions packages/site/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
2 changes: 1 addition & 1 deletion packages/site/src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"baseUrl": "../../",
"rootDir": "../../",
"module": "es2015",
"types": []
"types": ["node"]
},
"exclude": [
"test.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/site/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@ngx-rapid/core": ["./core/src/index"],
"@ngx-rapid/form": ["./form/src/index"],
"@ngx-rapid/crud": ["./crud/src/index"],
"*": ["site/node_modules/*"]
},
"baseUrl": "../",
"rootDir": "../",
"lib": [
Expand Down

0 comments on commit 157131a

Please sign in to comment.