angular6

Ng2-smart-table bind 'Add New' button event to an external button

流过昼夜 提交于 2019-12-13 03:48:42
问题 I have been using ng2-smart-table plugin for the table grid. There is an Add new button to add entry into the table. But i just want to trigger the 'Add new' event from an external button (May be top of the table but not within the table). There is a feature already available in the ng2-smart-table which is completely reverse to my requirement. That can be achieved by using 'mode:external' Currently this is open with their Github page as an issue. If they don't have an option with Ng2-smart

angular component is retaining old value maybe because the observable is resending past data

风格不统一 提交于 2019-12-13 03:31:33
问题 In the following pics, I visit a component, which on selecting a value from a drop down shows some values. If now, i click on home page and then revisit the component, then i still see the old values. Why is the component retaining old values? on start after selecting from drop box, the values gets populated now visit home page on revisiting, still seeing old values The html of the component is <div id="practice-questions-list-top-level-div"> <div id="practice-questions-tags-form-container" >

How to read XML file in Angular 4, 5, 6 and get output as String?

为君一笑 提交于 2019-12-13 03:19:31
问题 I am using an angular 6 and I want to read XML file. I have a sample file sample.xml to my local machine. <mail> <to>abc@gmail.com</to> <from>xyz@gmail.com</from> <heading>Reminder</heading> <body> Party this week !</body> </mail> and I want to chose file and fetch all file data as String. ex. same file as String: <mail><to>abc@gmail.com</to><from>xyz@gmail.com</from><heading>Reminder</heading><body> Party this week !</body></mail> 来源: https://stackoverflow.com/questions/54867549/how-to-read

For component interaction which method is best @Input, @output or using service

落花浮王杯 提交于 2019-12-13 03:04:42
问题 I am having some queries regarding component interaction in angular6.For component interaction we are having methods like @Input, @Output, viewChild and services. But most of the cases we will use services. At what situation we need to use @Input, @Output and viewChild for passing values in our application @Input, @Output and viewChild method having any limitations? Can we pass large amount of data or array of values Using @Input, @Output method. Can we use @Input and @Output within local

Angular 6 call localhost API

白昼怎懂夜的黑 提交于 2019-12-13 02:27:21
问题 I am trying to call an api locally in my angular 6 app, the api url is http://localhost/myapi I added a proxy config file that point to this url but I got 404 error when I run my app. My proxy.config.json file: { "/api/*":{ "target":"http://localhost/myapi", "secure": false, "logLevel": "debug" } } package.json file: "serve-dev": "ng serve --source-map=false --proxy-config proxy.config.json", http.service.ts file: export class HttpService{ static serverApiUrl : string = "/api/" } auth.service

Meta tag is not updating in view source - angular

陌路散爱 提交于 2019-12-13 02:19:52
问题 I am trying to update meta tag in angular 6 and angular univarsal but it changes only in inspect element not in view page source it remains the same which is on home page. Homepage.ts . . . import { SeoserviceService } from "./../../services/seoservice.service"; constructor(private metaService: Meta, public router: Router, public _seoService: SeoserviceService) { } ngOnInit() { this._seoService.updateTitle('Home'); //Updating Description tag dynamically with title this._seoService

use bootstrap 3 in angular 6

非 Y 不嫁゛ 提交于 2019-12-12 18:37:34
问题 how i can use bootstrab 3 in angular 6 ?? it's not work in any way , i used : npm install bootstrap@3 jquery --save then update angular.json as follow : "styles": [ "src/styles.css", "../../node_modules/bootstrap/dist/css/bootstrap.min.css" ], "scripts": [ "../../node_modules/jquery/dist/jquery.min.js", "../../node_modules/bootstrap/dist/js/bootstrap.min.js" ] in html bootstrap class appear , but it dosen't work !! it's git this error 91% additional asset processing scripts-webpack-plugin×

Chart.js canvas in Angular 6 is showing previous chart on mouse hover over the canvas

泪湿孤枕 提交于 2019-12-12 18:21:00
问题 I am trying to show multiple types of charts by giving user the option to select the type of chart he/she is interested in viewing. User can select the type of chart from the following HTML radio group code. <form> <label class="radio-inline"> <input type="radio" value="bar" name="optradio" (change)="onchange()" [(ngModel)]="chartType" checked>Bar Graph </label> <label class="radio-inline"> <input type="radio" value="pie" name="optradio" (change)="onchange()" [(ngModel)]="chartType">Pie Chart

How to change mat-form-field border color in angular material

别来无恙 提交于 2019-12-12 16:27:41
问题 I am trying to change the border color for my text box in angular material. Right now there are 3 different colors (hover, focus, idle). How can I change these colors? I want them different than my theme. <mat-form-field id="test" appearance="outline"> <mat-label class="test2">Outline form field</mat-label> <input matInput placeholder="name"> </mat-form-field> There are options to change the font size, but I can't seem to figure out the color: mat-form-field.mat-form-field { font-size: 16px;

Angular6: No Provider for Injector when using local library

不羁岁月 提交于 2019-12-12 13:06:17
问题 I'm somewhat new to Angular versions post AngularJS and decided to give them a try. What I want to do is to build a library of UI components, and an application that will consume the said library. In my library, I decided to create the components as WebComponents, so following the tutorials I've found so far, I have something like import { Injector, NgModule } from '@angular/core' import { createCustomElement } from '@angular/elements'; import { MyButtonComponent} from './my-button.component'