angular

Angular 2 default value in view

做~自己de王妃 提交于 2021-02-10 22:38:12
问题 I would like to give a default value of a variable in my view if it's empty or not defined : <p>{{(person | async)?.name}}</p> If the field name is empty, i would like to see this : <p>Default value</p> How can i do this ? 回答1: use || operator <p>{{(person | async)?.name || 'Default value'}}</p> 来源: https://stackoverflow.com/questions/51139331/angular-2-default-value-in-view

reusable component in angular

允我心安 提交于 2021-02-10 22:21:46
问题 im trying to create my own select component so the final result will be like that in app.components.html for example <div> <app-my-select [(ngModel)]="val"> <app-my-option value="1" >one</app-my-option> <app-my-option value="2" >two</app-my-option> <app-my-option value="3" >three</app-my-option> <app-my-option value="4" >four</app-my-option> </app-my-select> </div> in my-select.component.html <input (click)="openPanel()" class="select-value-container" readonly (keydown)="keyDown($event.key)"

reusable component in angular

不羁的心 提交于 2021-02-10 22:20:34
问题 im trying to create my own select component so the final result will be like that in app.components.html for example <div> <app-my-select [(ngModel)]="val"> <app-my-option value="1" >one</app-my-option> <app-my-option value="2" >two</app-my-option> <app-my-option value="3" >three</app-my-option> <app-my-option value="4" >four</app-my-option> </app-my-select> </div> in my-select.component.html <input (click)="openPanel()" class="select-value-container" readonly (keydown)="keyDown($event.key)"

Deploying Angular 6 app on Nginx - Forbidden

两盒软妹~` 提交于 2021-02-10 22:16:57
问题 I'm trying to deploy Angular app with Nginx Here is my nginx conf: server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name mysite.com; root /home/forge/mysite.com/dist/; ssl_certificate /etc/nginx/ssl/mysite.com/370952/server.crt; ssl_certificate_key /etc/nginx/ssl/mysite.com/370952/server.key; ssl_protocols TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; ssl_prefer_server

Deploying Angular 6 app on Nginx - Forbidden

二次信任 提交于 2021-02-10 22:10:34
问题 I'm trying to deploy Angular app with Nginx Here is my nginx conf: server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name mysite.com; root /home/forge/mysite.com/dist/; ssl_certificate /etc/nginx/ssl/mysite.com/370952/server.crt; ssl_certificate_key /etc/nginx/ssl/mysite.com/370952/server.key; ssl_protocols TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; ssl_prefer_server

Deploying Angular 6 app on Nginx - Forbidden

微笑、不失礼 提交于 2021-02-10 22:09:50
问题 I'm trying to deploy Angular app with Nginx Here is my nginx conf: server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name mysite.com; root /home/forge/mysite.com/dist/; ssl_certificate /etc/nginx/ssl/mysite.com/370952/server.crt; ssl_certificate_key /etc/nginx/ssl/mysite.com/370952/server.key; ssl_protocols TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; ssl_prefer_server

ERROR in Invalid or unexpected token on Angular production build

做~自己de王妃 提交于 2021-02-10 21:42:30
问题 chunk {0} runtime.06daa30a2963fa413676.js, runtime.06daa30a2963fa413676.js.map (runtime) 1.5 kB [entry] [rendered] chunk {1} main.9868d9b237c3a48c54da.js, main.9868d9b237c3a48c54da.js.map (main) 182 bytes [initial] [rendered] chunk {2} polyfills.85f47f0bf59079cbc23a.js, polyfills.85f47f0bf59079cbc23a.js.map (polyfills) 189 bytes [initial] [rendered] chunk {3} styles.da6a8dc1b4027cfd731e.css, styles.da6a8dc1b4027cfd731e.css.map (styles) 338 kB [initial] [rendered] ERROR in Invalid or

ERROR in Invalid or unexpected token on Angular production build

家住魔仙堡 提交于 2021-02-10 21:42:22
问题 chunk {0} runtime.06daa30a2963fa413676.js, runtime.06daa30a2963fa413676.js.map (runtime) 1.5 kB [entry] [rendered] chunk {1} main.9868d9b237c3a48c54da.js, main.9868d9b237c3a48c54da.js.map (main) 182 bytes [initial] [rendered] chunk {2} polyfills.85f47f0bf59079cbc23a.js, polyfills.85f47f0bf59079cbc23a.js.map (polyfills) 189 bytes [initial] [rendered] chunk {3} styles.da6a8dc1b4027cfd731e.css, styles.da6a8dc1b4027cfd731e.css.map (styles) 338 kB [initial] [rendered] ERROR in Invalid or

Implementing Session Timeout service for Ionic/Angular, with Timer Reset with each new user interaction

可紊 提交于 2021-02-10 20:39:31
问题 I'm trying to adapt some code I've created for a session timeout. Whenever a user interacts with the function, I want to reset the timer to start counting down again. I'm having difficulty working out how to inject similar code to this example C# code - I'm trying to integrate: var update = new Subject<bool>(); var res = update .Select(x => Observable.Interval(TimeSpan.FromSeconds(10.0))) .Switch(); res .Subscribe(_ => Console.WriteLine("Status sent.")); update.OnNext(true); res .Subscribe(_

Implementing Session Timeout service for Ionic/Angular, with Timer Reset with each new user interaction

帅比萌擦擦* 提交于 2021-02-10 20:36:55
问题 I'm trying to adapt some code I've created for a session timeout. Whenever a user interacts with the function, I want to reset the timer to start counting down again. I'm having difficulty working out how to inject similar code to this example C# code - I'm trying to integrate: var update = new Subject<bool>(); var res = update .Select(x => Observable.Interval(TimeSpan.FromSeconds(10.0))) .Switch(); res .Subscribe(_ => Console.WriteLine("Status sent.")); update.OnNext(true); res .Subscribe(_