File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 " projects/ngqp-demo/src/assets"
5959 ],
6060 "styles" : [
61- " projects/ngqp-demo/src/styles.css"
61+ " projects/ngqp-demo/src/styles.css" ,
62+ " node_modules/bootstrap/dist/css/bootstrap.min.css"
6263 ],
6364 "scripts" : []
6465 },
Original file line number Diff line number Diff line change 2323 "@angular/platform-browser" : " ~7.1.0" ,
2424 "@angular/platform-browser-dynamic" : " ~7.1.0" ,
2525 "@angular/router" : " ~7.1.0" ,
26+ "@ng-bootstrap/ng-bootstrap" : " ^4.0.0" ,
2627 "@ngqp/core" : " ./projects/ngqp/core" ,
28+ "bootstrap" : " ^4.1.3" ,
2729 "core-js" : " ^2.5.4" ,
2830 "rxjs" : " ~6.3.3" ,
2931 "tslib" : " ^1.9.0" ,
Original file line number Diff line number Diff line change 1+ import { NgModule } from '@angular/core' ;
2+ import { RouterModule , Routes } from '@angular/router' ;
3+ import { PlaygroundComponent } from './playground/playground.component' ;
4+
5+ const routes : Routes = [
6+ {
7+ path : 'playground' ,
8+ component : PlaygroundComponent ,
9+ } ,
10+ {
11+ path : '**' ,
12+ redirectTo : '/playground' ,
13+ } ,
14+ ] ;
15+
16+ @NgModule ( {
17+ imports : [
18+ RouterModule . forRoot ( routes ) ,
19+ ] ,
20+ exports : [ RouterModule ] ,
21+ } )
22+ export class AppRoutingModule {
23+ }
Original file line number Diff line number Diff line change 1- < div [queryParamGroup] ="paramGroup ">
2- < input type ="text " placeholder ="Search " queryParamName ="search " />
3- < button type ="button " routerLink ="./ " [queryParams] ="{q: 'foo'} " queryParamsHandling ="merge "> Go to ?q=foo</ button >
1+ < nav class ="navbar navbar-expand-lg navbar-light bg-light ">
2+ < img src ="assets/logo.svg " height ="48 " width ="auto " />
3+ < a class ="navbar-brand " routerLink ="/ "> @ngqp</ a >
4+ < button class ="navbar-toggler " type ="button " (click) ="isNavbarExpanded = !isNavbarExpanded ">
5+ < span class ="navbar-toggler-icon "> </ span >
6+ </ button >
47
5- < br />
8+ < div class ="navbar-collapse " [class.collapse] ="!isNavbarExpanded ">
9+ < ul class ="navbar-nav mr-auto ">
10+ < li class ="nav-item active ">
11+ < a class ="nav-link " href ="/playground "> Playground</ a >
12+ </ li >
13+ </ ul >
14+ </ div >
15+ </ nav >
616
7- < select queryParamName ="type ">
8- < option [value] ="1 "> Dog</ option >
9- < option [value] ="2 "> Cat</ option >
10- < option [value] ="3 "> Mouse</ option >
11- </ select >
12- </ div >
17+ < div class ="alert alert-danger " role ="alert ">
18+ @ngqp is still under early development. This website currently serves only as a playground.
19+ </ div >
20+
21+ < main role ="main " class ="container mt-5 ">
22+ < router-outlet > </ router-outlet >
23+ </ main >
Original file line number Diff line number Diff line change 11import { Component } from '@angular/core' ;
2- import { QueryParamBuilder , QueryParamGroup } from '@ngqp/core' ;
32
43@Component ( {
54 selector : 'app-root' ,
65 templateUrl : './app.component.html' ,
76} )
87export class AppComponent {
98
10- public paramGroup : QueryParamGroup ;
11-
12- constructor ( private queryParamBuilder : QueryParamBuilder ) {
13- this . paramGroup = queryParamBuilder . group ( {
14- search : queryParamBuilder . param ( {
15- name : 'q' ,
16- } ) ,
17- type : queryParamBuilder . param ( {
18- serialize : ( value : number | null ) => value === null ? null : `V${ value } ` ,
19- deserialize : ( value : string | null ) => value ? + value [ 1 ] : 1 ,
20- } ) ,
21- } ) ;
22- }
9+ public isNavbarExpanded = false ;
2310
2411}
Original file line number Diff line number Diff line change 1- import { BrowserModule } from '@angular/platform-browser' ;
21import { NgModule } from '@angular/core' ;
3- import { AppComponent } from './app.component' ;
4- import { QueryParamModule } from '@ngqp/core' ;
5- import { RouterModule } from '@angular/router' ;
2+ import { BrowserModule } from '@angular/platform-browser' ;
63import { FormsModule } from '@angular/forms' ;
4+ import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
5+ import { QueryParamModule } from '@ngqp/core' ;
6+ import { AppRoutingModule } from './app-routing.module' ;
7+ import { AppComponent } from './app.component' ;
8+ import { PlaygroundComponent } from './playground/playground.component' ;
79
810@NgModule ( {
911 declarations : [
10- AppComponent
12+ AppComponent ,
13+ PlaygroundComponent
1114 ] ,
1215 imports : [
1316 BrowserModule ,
1417 FormsModule ,
15- RouterModule . forRoot ( [ ] ) ,
18+ AppRoutingModule ,
19+ NgbModule ,
1620 QueryParamModule
1721 ] ,
1822 providers : [ ] ,
Original file line number Diff line number Diff line change 1+ < ng-container [queryParamGroup] ="paramGroup ">
2+ < input type ="text " class ="form-control " placeholder ="Search " queryParamName ="searchText " />
3+ </ ng-container >
Original file line number Diff line number Diff line change 1+ import { Component } from '@angular/core' ;
2+ import { QueryParamBuilder , QueryParamGroup } from '@ngqp/core' ;
3+
4+ @Component ( {
5+ templateUrl : './playground.component.html' ,
6+ } )
7+ export class PlaygroundComponent {
8+
9+ public paramGroup : QueryParamGroup ;
10+
11+ constructor ( private queryParamBuilder : QueryParamBuilder ) {
12+ this . paramGroup = queryParamBuilder . group ( {
13+ searchText : queryParamBuilder . param ( {
14+ name : 'q'
15+ } ) ,
16+ } ) ;
17+ }
18+
19+ }
You can’t perform that action at this time.
0 commit comments