angular7

Form with Custom Component does not recognize control

隐身守侯 提交于 2020-07-30 04:06:28
问题 I am using a custom component (custom-text) which has the below code @Component({ selector: 'custom-text, [custom-text]', templateUrl: './custom-text.template.html', styleUrls: ['./custom-text.component.scss'] }) export class CustomTextComponent implements OnInit { constructor() { } ngOnInit() { } } Inside the custom-text.template.html <mat-form-field> <input matInput id="controlid" name="controlname" maxlength="8" [(ngModel)]="value"> </mat-form-field> When I include this control inside a

Form with Custom Component does not recognize control

让人想犯罪 __ 提交于 2020-07-30 04:06:22
问题 I am using a custom component (custom-text) which has the below code @Component({ selector: 'custom-text, [custom-text]', templateUrl: './custom-text.template.html', styleUrls: ['./custom-text.component.scss'] }) export class CustomTextComponent implements OnInit { constructor() { } ngOnInit() { } } Inside the custom-text.template.html <mat-form-field> <input matInput id="controlid" name="controlname" maxlength="8" [(ngModel)]="value"> </mat-form-field> When I include this control inside a

Multi-select with cdk-virtual-for making it look like nothing was selected

岁酱吖の 提交于 2020-07-21 07:03:18
问题 I have a couple of angular material multi-selects that are utilizing the new Virtual for in the CDK. When you select a couple of items and scroll them out of view, thus dropping them from the virtual for and then close the select, it looks like the inputs were dropped, but when opening up the select and scrolling back up you see they are still selected. Here is an imgur album displaying my issue: https://imgur.com/a/8CVXulD The only workaround I've been able to come up with is that I can

Windows Authentication and Angular 7 application

醉酒当歌 提交于 2020-07-19 11:01:49
问题 I have developed intranet application Backend: ASP.NET WEB API-2 (All controllers have Authorize attribute), Frontend: Angular 7 (after prod build I moved generated scripts to my backend project): .... <app-root> <div id="preloader"></div> </app-root> <script type="text/javascript" src="~/Scripts/SPA/runtime.26209474bfa8dc87a77c.js"></script> <script type="text/javascript" src="~/Scripts/SPA/es2015-polyfills.bda95d5896422d031328.js" nomodule></script> <script type="text/javascript" src="~

Could not load the config file in service - vendor js 65401

随声附和 提交于 2020-07-10 10:26:26
问题 It works fine in injecting into components. problem occurs in service injection. I am using runtime configuration for end points.it works in components.i can able to change in runtime but throws an error when injecting in other services global export class AppConfigService { static settings: IAppConfig; constructor(private http: HttpClient) {} load() { const jsonFile = `../assets/config/config.json`; return new Promise<void>((resolve, reject) => { this.http.get(jsonFile).toPromise().then(

How to get navigation history?

时间秒杀一切 提交于 2020-07-08 14:01:14
问题 I am trying to implement a menu including the most recently visited and most commonly visited pages within the Angular app. How can I get the navigation stack? Or do I need to hook the navigationStart event and compile it as it is created? 回答1: I don't think it is possible to get the full history with a simple method call, but you can track this easily yourself by subscribing to the NavigationEnd. previousUrl: string; constructor(router: Router) { router.events .filter(event => event

How to get navigation history?

China☆狼群 提交于 2020-07-08 13:59:24
问题 I am trying to implement a menu including the most recently visited and most commonly visited pages within the Angular app. How can I get the navigation stack? Or do I need to hook the navigationStart event and compile it as it is created? 回答1: I don't think it is possible to get the full history with a simple method call, but you can track this easily yourself by subscribing to the NavigationEnd. previousUrl: string; constructor(router: Router) { router.events .filter(event => event

Angular 7 : ng test hangs , keeps running tests repeatedly

我只是一个虾纸丫 提交于 2020-07-06 08:59:14
问题 i ve recently migrated my Angular 6 app to Angular 7 my package.json looks like this : { "name": "myApp", "version": "3.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve --public-host http://localhost:4200/", "build": "ng build --prod", "serve": "ng serve --optimization=true --source-map=true --eval-source-map=true --live-reload=true --aot=false --vendor-chunk=true", "build-prod": "node --max_old_space_size=5000 ./node_modules/.bin/ng build --configuration=production",

Angular 7 : ng test hangs , keeps running tests repeatedly

孤街浪徒 提交于 2020-07-06 08:57:32
问题 i ve recently migrated my Angular 6 app to Angular 7 my package.json looks like this : { "name": "myApp", "version": "3.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve --public-host http://localhost:4200/", "build": "ng build --prod", "serve": "ng serve --optimization=true --source-map=true --eval-source-map=true --live-reload=true --aot=false --vendor-chunk=true", "build-prod": "node --max_old_space_size=5000 ./node_modules/.bin/ng build --configuration=production",

How do I display a base64 image in Angular 7?

我是研究僧i 提交于 2020-06-29 06:10:35
问题 I want to take the base64 string and use it to display the image. Below is the HTML file. I want to use the base64 string and use it in the img tag: <ion-content> <ion-card> <img src={{imageFileBinary}} /> <ion-card-header> <form> <ion-input id="myform" type="file" name="file" (change)="postMethod($event.target.files)"></ion-input> </form> <ion-card-title>Nick</ion-card-title> </ion-card> </ion-content> I get imageFileBinary from the .ts file. Below is the .ts file: export class MyprofilePage