angular6

Angular 6 - Dynamic Routing with Prefix

点点圈 提交于 2020-01-02 04:35:17
问题 I am working on an Angular Universal Application. I want to create dynamic routes with custom prefix but I am unable find any helpful documentation related with my case. Any Help will be appreciated... Details: What I have is, I have 4 pages with 4 different dynamic URLs which are: Home Page ( http://example.com/ ) Category Page ( http://example.com/{category_name} ) Sub Category Page ( http://example.com/{category_name}/{sub_category_name} ) Product Page ( http://example.com/p{product_id}-

[Angular-CLI-6]Could not determine single project for 'Serve' target

▼魔方 西西 提交于 2020-01-02 03:32:26
问题 I have updated my angular-cli with the help of ng update @angular/cli command. After that, I have got an error as Could not determine single project for 'server' target with following error trace. Could not determine a single project for the 'serve' target. Error: Could not determine a single project for the 'serve' target. at ServeCommand.getProjectNamesByTarget (E:\Angular\Projects\projectName\node_modules\@angular\cli\models\architect-command.js:175:19) at ServeCommand.<anonymous> (E:

routerLink not working in Angular 6

白昼怎懂夜的黑 提交于 2020-01-02 03:20:17
问题 I'm learning Angular 6 . I have designed my application structure in hierarchy form with following structure. my_app |- src |- app |- layout |- admin-layout |- admin-layout.module.ts |- admin-layout.routing.ts |- admin-layout.component.html |- contacts |- contact-list |- contact-list.component.ts |- contact-list.component.html |- contacts.module.ts |- transaction |- amount-given |- amount-given-list |- amount-given-list.component.ts |- amount-given-list.component.html |- amount-given.module

Pass multiple values to pipe in Angular 6

那年仲夏 提交于 2020-01-02 01:31:05
问题 I need to create a search form in Angular 6 with pipe and must pass multiple arguments to pipe . nameSearch , emailSearch , roleSeach , accountSearch <tr *ngFor="let user of data | searchuser: nameSearch" ></tr> and this my pipe : @Pipe({ name: 'searchuser' }) export class SearchuserPipe implements PipeTransform { transform(users: IUser[], nameSearch: string): IUser[] { if(!users) return []; if(!nameSearch) return users; nameSearch=nameSearch.toLocaleLowerCase(); return users.filter(item=> {

Unknown option --extractCss in AspNetCore Angular 6.0 SPA Template

别来无恙 提交于 2020-01-02 00:56:08
问题 I have scaffolded AspNetCore Angular 6.0 SPA template from cli and then installed npm package accordingly. However when i try to run the project dotnet run it does not start rather prompted with and error. I have captured a screenshot for your reference. I am not sure whether it is something to do with angular.Json file or else!!! Any idea.. Error: Unknown option --extractCss 回答1: This is because the ng serve command no longer supports --extractCss option Open package.json . You'll find {

Angular : Unable to pass API url in SignalR HubConnection

偶尔善良 提交于 2020-01-01 11:49:28
问题 I have developed a project in Angular6. There is a requirement to develop section for live chat. For that I am using SignalR in my asp.net core Web Apiproject. Now I want to use this Web Api reference in my Angular project. I am using this link. But while providing the Web Api url in App.Component.ts, I am getting below error : Constructor of class 'HubConnection' is private and only accessible within the class declaration. App Component.ts : import { HubConnection } from '@aspnet/signalr';

Angular Material v6 Mat-Footer - “Cannot read property 'template' of undefined”

≯℡__Kan透↙ 提交于 2020-01-01 09:32:56
问题 I'm trying to implement a footer row into a mat-table component after recently upgrading to angular 6 for this purpose, but after adding both the mat-footer-cell and mat-footer-row elements in the table, I get the following error: ERROR TypeError: Cannot read property 'template' of undefined at MatFooterRowDef.push../node_modules/@angular/cdk/esm5/table.es5.js.CdkFooterRowDef.extractCellTemplate (vendor.js:17400) The table still appears on the page, but with no data, no footer row, and a T

Angular Material v6 Mat-Footer - “Cannot read property 'template' of undefined”

允我心安 提交于 2020-01-01 09:31:46
问题 I'm trying to implement a footer row into a mat-table component after recently upgrading to angular 6 for this purpose, but after adding both the mat-footer-cell and mat-footer-row elements in the table, I get the following error: ERROR TypeError: Cannot read property 'template' of undefined at MatFooterRowDef.push../node_modules/@angular/cdk/esm5/table.es5.js.CdkFooterRowDef.extractCellTemplate (vendor.js:17400) The table still appears on the page, but with no data, no footer row, and a T

Cannot get relative image path in angular 6

坚强是说给别人听的谎言 提交于 2019-12-31 07:47:06
问题 This is the structure of my folders angular-src --src --app ----components ------whatever.html public --images ----01.jpg I want to access 01.jpg from whatever.html . I tried many alternatives like <img src="../../../../public/images/01.jpg"> or <img src="../../../../../public/images/01.jpg"> and I keep getting 404. I use angular 6 and node 8.11.1. What am I missing here? Thanks 回答1: At first you should move your assets like the img you use into the assets folder which is a direct child of

Angular 6 : where getting error module “rxjs/add/operator/map” and another error 'map' does not exist on type 'Observable<Response>'

陌路散爱 提交于 2019-12-30 17:20:30
问题 I am using Angular 6 where I am getting two errors - ERROR in ./src/app/app/img/img.service.ts Module not found: Error: Can't resolve 'rxjs/add/operator/map' in '/Users/user/Projects/A4/imageSearch/src/app/app/img' ERROR in src/app/app/img/img.service.ts(21,9): error TS2339: Property 'map' does not exist on type 'Observable'. 回答1: I faced similar problem with rxjs map operator. Currently I'm using Angular 6. To know which version you are using: ng --version or ng -v If you are also using