Skip to content

Commit 8037a39

Browse files
committed
feat(docs): Added installation guide
1 parent ca7303d commit 8037a39

15 files changed

Lines changed: 177 additions & 15 deletions

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"add": "^2.0.6",
3737
"bootstrap": "^4.1.3",
3838
"core-js": "^2.5.4",
39+
"prismjs": "^1.15.0",
3940
"rxjs": "~6.3.3",
4041
"tslib": "^1.9.0",
4142
"yarn": "^1.12.3",
@@ -50,6 +51,7 @@
5051
"@types/jasmine": "~2.8.8",
5152
"@types/jasminewd2": "~2.0.3",
5253
"@types/node": "~8.9.4",
54+
"@types/prismjs": "^1.9.0",
5355
"angular-cli-ghpages": "^0.5.3",
5456
"codelyzer": "~4.5.0",
5557
"jasmine-core": "~2.99.1",

projects/ngqp-demo/src/app/demo-routing.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';
33
import { HomeComponent } from './home/home.component';
4+
import { GettingStartedComponent } from './getting-started/getting-started.component';
45

56
const routes: Routes = [
67
{
@@ -9,8 +10,8 @@ const routes: Routes = [
910
component: HomeComponent,
1011
},
1112
{
12-
path: 'guide',
13-
component: HomeComponent,
13+
path: 'getting-started',
14+
component: GettingStartedComponent,
1415
},
1516
{
1617
path: '**',

projects/ngqp-demo/src/app/demo.component.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
<span>ngqp</span>
1010
</a>
1111
<div class="navbar-collapse" [class.collapse]="!isNavbarExpanded">
12-
<ul class="navbar-nav mr-auto">
13-
<li class="nav-item">
14-
<a class="nav-link" routerLink="/guide">Getting started</a>
15-
</li>
16-
<li class="nav-item">
17-
<a class="nav-link" routerLink="/">Tutorial</a>
18-
</li>
19-
<li class="nav-item">
20-
<a class="nav-link" routerLink="/">API Documentation</a>
21-
</li>
22-
</ul>
12+
<div class="navbar-nav mr-auto">
13+
<a class="nav-item" routerLink="/getting-started" routerLinkActive="active">
14+
<span class="nav-link">Getting started</span>
15+
</a>
16+
<a class="nav-item" routerLink="/tutorial" routerLinkActive="active">
17+
<span class="nav-link">Tutorial</span>
18+
</a>
19+
<a class="nav-item" href="#">
20+
<span class="nav-link">API Documentation</span>
21+
</a>
22+
</div>
2323
</div>
2424
<a href="https://ngqp.io" rel="nofollow noopener" [class.collapse]="isNavbarExpanded">
2525
<fa-icon [icon]="faGithub" size="2x" class="text-light"></fa-icon>

projects/ngqp-demo/src/app/demo.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
background-color: white;
33
border-radius: 50%;
44
margin-right: 8px;
5+
}
6+
7+
.navbar-nav a {
8+
text-decoration: none;
59
}

projects/ngqp-demo/src/app/demo.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ import { DemoComponent } from './demo.component';
99
import { DemoBrowserComponent } from './shared/demo-browser/demo-browser.component';
1010
import { DemoPaginationComponent } from './shared/demo-pagination/demo-pagination.component';
1111
import { HomeComponent } from './home/home.component';
12+
import { GettingStartedComponent } from './getting-started/getting-started.component';
13+
import { DemoSnippetComponent } from './shared/demo-snippet/demo-snippet.component';
1214

1315
@NgModule({
1416
declarations: [
1517
DemoComponent,
1618
DemoBrowserComponent,
1719
DemoPaginationComponent,
1820
HomeComponent,
21+
GettingStartedComponent,
22+
DemoSnippetComponent,
1923
],
2024
imports: [
2125
BrowserModule,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<main class="container mt-5">
2+
<h1>Installation</h1>
3+
ngqp supports schematics, so simply run the following command in your project:
4+
<demo-snippet type="bash" code="ng add @ngqp/core"></demo-snippet>
5+
6+
<hr />
7+
8+
You can also install it manually using
9+
<demo-snippet type="bash" code="yarn add @ngqp/core"></demo-snippet>
10+
11+
and then importing it to your app's root module:
12+
<demo-snippet type="typescript" [code]="snippets['MODULE_IMPORT']"></demo-snippet>
13+
</main>

projects/ngqp-demo/src/app/getting-started/getting-started.component.scss

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Component } from '@angular/core';
2+
3+
const SNIPPETS: { [ key: string ]: string } = {
4+
MODULE_IMPORT: `
5+
@NgModule({
6+
imports: [
7+
QueryParamModule.forRoot(),
8+
],
9+
})
10+
export class AppModule {}`,
11+
};
12+
13+
@Component({
14+
selector: 'demo-getting-started',
15+
templateUrl: './getting-started.component.html',
16+
styleUrls: [ './getting-started.component.scss' ]
17+
})
18+
export class GettingStartedComponent {
19+
20+
public snippets = SNIPPETS;
21+
22+
}

projects/ngqp-demo/src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h1>ngqp</h1>
77
<p>Declaratively synchronize form controls with the URL</p>
88
<div class="btn-block">
9-
<a class="btn btn-lg btn-primary" routerLink="/guide">Get started</a>
9+
<a class="btn btn-lg btn-primary" routerLink="/getting-started">Get started</a>
1010
<a class="btn btn-lg btn-outline-secondary" href="https://www.github.com/Airblader/ngqp">Github</a>
1111
</div>
1212
</section>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!-- It's important to keep this on one line due to whitespaces -->
2+
<pre class="demo-snippet__pre language-{{ type }}"><code #code class="language-{{ type }}"></code></pre>

0 commit comments

Comments
 (0)