File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77.links {
88 font-family : sans-serif;
99}
10+
11+ .dev-tools {
12+ background : # DD0031 ;
13+ border-color : # C3002F ;
14+ margin-top : 11px ;
15+ padding : 6px 9px ;
16+ color : # FFF ;
17+ font-family : Verdana, Tahoma, sans-serif;
18+ font-size : 18px ;
19+ }
Original file line number Diff line number Diff line change 77 < div >
88 {{ versions }}
99 </ div >
10+ < button
11+ *ngIf ="isDev "
12+ class ="dev-tools "
13+ (click) ="openDevTools($event) "
14+ >
15+ Open Dev Tools
16+ </ button >
1017</ div >
1118
1219< div class ="links ">
Original file line number Diff line number Diff line change @@ -8,16 +8,17 @@ import { Component } from '@angular/core';
88
99export class AppComponent {
1010 title = 'nw-angular' ;
11+ isDev = window . nw . process . versions [ 'nw-flavor' ] === 'sdk' ;
1112
1213 versions = '' +
13- 'You are running NW.js (v' + window . nw . process . versions . nw + '), ' +
14+ 'You are running NW.js (v' + window . nw . process . versions . nw + ' ' + window . nw . process . versions [ 'nw-flavor' ] + ' ), ' +
1415 'Node.js (v' + window . nw . process . versions . node + '), ' +
1516 'Chromium (v' + window . nw . process . versions . chromium + '), ' +
16- 'and Angular 8 .' ;
17+ 'and Angular (v8.0.3) .' ;
1718
1819 public links : any ;
1920
20- constructor ( ) {
21+ constructor ( ) {
2122 this . links = [
2223 {
2324 title : 'Angular Tutorial' ,
@@ -34,8 +35,13 @@ export class AppComponent {
3435 ]
3536 }
3637
37- public open ( evt , link ) {
38+ public open ( evt , link ) {
3839 evt . preventDefault ( ) ;
3940 window . nw . Shell . openExternal ( link . url ) ;
4041 }
42+
43+ public openDevTools ( evt ) {
44+ evt . preventDefault ( ) ;
45+ window . nw . Window . get ( ) . showDevTools ( ) ;
46+ }
4147}
You can’t perform that action at this time.
0 commit comments