angular5

How to use ActivatedRoute in Angular 5?

时光怂恿深爱的人放手 提交于 2020-08-18 14:20:37
问题 I am trying to do exactly the same thing as in this post: Angular 4 get queryString I am using Angular 5.2.5. ActivatedRoute seems to be the thing to use to retrieve querystring values off the URL when the user first visits the website. However, I am unable to figure out what I need to import to be able to use ActivatedRoute. Could someone specify exactly what needs to be added to the app.module.ts file, and the component.ts file where I am trying to use ActivatedRoute? This post specifies

How to use ActivatedRoute in Angular 5?

拜拜、爱过 提交于 2020-08-18 14:20:07
问题 I am trying to do exactly the same thing as in this post: Angular 4 get queryString I am using Angular 5.2.5. ActivatedRoute seems to be the thing to use to retrieve querystring values off the URL when the user first visits the website. However, I am unable to figure out what I need to import to be able to use ActivatedRoute. Could someone specify exactly what needs to be added to the app.module.ts file, and the component.ts file where I am trying to use ActivatedRoute? This post specifies

How to use primeng dropdown?

北慕城南 提交于 2020-08-11 02:59:25
问题 I used the "select" for the dropdown. Below is the coding. <div class="ui-grid-col-6"> <div class="form-group"> <select name="status" formControlName="purchaseOrderStatusId"> <option>Select PurchaseOrderStatus</option> <option *ngFor="let PurchaseOrderStatus of allPurchaseOrderStatus" value="{{ PurchaseOrderStatus.id }}"> {{ PurchaseOrderStatus.code }} </option> </select> </div> </div> Here all values from the API are saved in the variable allPurchaseOrderStatus . And I want id as my stored

Upgraded to Angular 5 : TS6046 and TS5024 errors

大兔子大兔子 提交于 2020-08-02 08:14:18
问题 We upgraded our application to Angular 5.0.0 and we're getting two errors while trying to run the ng serve or ng build command : error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'. error TS5024: Compiler option 'lib' requires a value of type Array. Here is the tsconfig.js file : { "compileOnSave": true, "compilerOptions": { "module": "commonjs", "outDir": "./dist/out-tsc", "baseUrl": "src", "sourceMap": true,

How to change page title with routing in Angular application?

浪尽此生 提交于 2020-07-31 07:26:24
问题 Is there any npm module/ other way like React-Helmet that allows us to change page title as we route through our Angular application? PS: I am using Angular 5. 回答1: You have a TitleService in Angular 5. Inject it in your component's constructor, and use the setTitle() method. import {Title} from "@angular/platform-browser"; .... constructor(private titleService:Title) { this.titleService.setTitle("Some title"); } Here are the docs from Angular: https://v2.angular.io/docs/ts/latest/cookbook

Show text inside nvd3 half circle donut chart

限于喜欢 提交于 2020-07-31 04:53:26
问题 In my project I am using nvd3 chart. This particular graph is a piechart(donut chart) which is half circle. I am successfully able to plot the half circle donut chart. The next requirement is to show few values dynamically inside the chart. That is not working. Here is my data: { key: "allocation", values: [[{x: "Lower my cholesterol", y: 207, individualEligiblePercent: "16.76"}] [{x: "Total registered", y: 549}]] [[{x: "Healthy pregnancy", y: 193, individualEligiblePercent: "15.63"}] [{x: