angular6

Angular 6 How To Get Values From Multiple Checkboxes and Send in From

左心房为你撑大大i 提交于 2019-12-02 11:04:57
I'm trying to use mat-checkboxes as input in my form, but can't really find anything on docs regarding it. Html <section class="checkbox-section"> <mat-checkbox [(ngModel)]="bChecked">Blogs</mat-checkbox> <mat-checkbox [(ngModel)]="wChecked">Web</mat-checkbox> <mat-checkbox [(ngModel)]="oChecked">Online News</mat-checkbox> </section> Typescript public form = { name: null, email: null, birthday: null, company: null, interests: [], newsletter: null, address: null, password: null, password_confirmation: null, }; I'm trying to get the values of the checkboxes which are static and then push to my

ckeditor is undefined in Angular 6

烈酒焚心 提交于 2019-12-02 10:16:48
I am using ckeditor in Angular 6. And trying to create a instance while uploading image saveToServer(file: File) { this.appService.saveEditorimage(file).subscribe(data => { this.response = data.json(); var url = "/images/" + this.response[0].filename console.log(url) // this.ckEditor let link = this.ckEditor.instance.document.createElement("img"); link.setAttribute("alt", "Image"); link.setAttribute("src", url); this.ckEditor.instance.insertElement(link); }) } this.ckEditor is undefined. How Do i fix this issue. 来源: https://stackoverflow.com/questions/55298230/ckeditor-is-undefined-in-angular

Angular 6 Http Interceptors, request headers not modified

霸气de小男生 提交于 2019-12-02 09:48:27
I created an interceptor to add an authorization header to each request sent by the client, here is the code : import { HttpInterceptor, HttpRequest, HttpHandler, HttpHeaderResponse, HttpSentEvent, HttpProgressEvent, HttpResponse, HttpUserEvent, HttpEvent, HttpHeaders } from "@angular/common/http"; import { Observable } from "rxjs"; import { Injectable } from "@angular/core"; @Injectable() export class AuthenticationInterceptor implements HttpInterceptor { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { console.log(localStorage.getItem('jwtToken')); if

Transform pipe in Angular 6 with Observable or Promise

泪湿孤枕 提交于 2019-12-02 07:04:46
问题 I trying to set Pipe in angular 6 that convert text to other with using service (the method that returns observable) I tried the following code, but I need to return a string instead of Promise Pipe: import { Pipe, PipeTransform } from '@angular/core'; import { TimeZoneService, TimeZone } from '../services/Global/timezone.service'; //import { resolve } from 'dns'; import { reject } from 'q'; import { Observable } from 'rxjs'; @Pipe({ name: 'utcToText' }) export class UtcToTextPipe implements

how to create an array of times with half hour intervals instead of declare in variable

﹥>﹥吖頭↗ 提交于 2019-12-02 06:48:33
问题 i have an long const values below like this ,is it possible to create in function in typescript to reduce a long const. export const DepartTime = ['00.00', '00.30', '01.00', '01.30', '02.00', '02.30', '03.00', '03.30', '04.00', '04.30', '05.00', '05.30', '06.00', '06.30', '07.00', '07.30', '08.00', '08.30', '09.00', '09.30', '10.00', '10.30', '11.00', '11.30', '12.00', '12.30', '13.00', '13.30', '14.00', '14.30', '15.00', '15.30', '16.00', '16.30', '17.00', '17.30', '18.00', '18.30', '19.00',

Can´t add Bootstrap 4 in Angular 6

蓝咒 提交于 2019-12-02 06:05:54
问题 I have the problem when I try to add the latest bootstrap version with npm install bootstrap After that, I got an error message when I tried to run it. ng serve --open I Add Bootstrap in angular.json like this "styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ], And the error message is ERROR in multi ../node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css Module not found: Error: Can't resolve '...\node_modules\bootstrap\dist\css\bootstrap.min

how to create an array of times with half hour intervals instead of declare in variable

余生颓废 提交于 2019-12-02 05:37:39
i have an long const values below like this ,is it possible to create in function in typescript to reduce a long const. export const DepartTime = ['00.00', '00.30', '01.00', '01.30', '02.00', '02.30', '03.00', '03.30', '04.00', '04.30', '05.00', '05.30', '06.00', '06.30', '07.00', '07.30', '08.00', '08.30', '09.00', '09.30', '10.00', '10.30', '11.00', '11.30', '12.00', '12.30', '13.00', '13.30', '14.00', '14.30', '15.00', '15.30', '16.00', '16.30', '17.00', '17.30', '18.00', '18.30', '19.00', '19.30', '20.00', '20.30', '21.00', '21.30', '22.00', '22.30', '23.00', '23.30' ]; These values need

Multiple Angular Elements from different scripts

依然范特西╮ 提交于 2019-12-02 04:12:22
问题 Is it possible to use Angular Elements generated from diffrent scripts? I have 2 projects weather-widget and clock widget which generates their own script(concated all required ones). When I use these widgets individually it works fine but when these are used on same page it gives error shown as below: DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at CustomElementRegistry.define (http://172.27.147.64:8080/node_modules

Can´t add Bootstrap 4 in Angular 6

試著忘記壹切 提交于 2019-12-02 01:22:15
I have the problem when I try to add the latest bootstrap version with npm install bootstrap After that, I got an error message when I tried to run it. ng serve --open I Add Bootstrap in angular.json like this "styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ], And the error message is ERROR in multi ../node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css Module not found: Error: Can't resolve '...\node_modules\bootstrap\dist\css\bootstrap.min.css' in '...' Why did I get the error message? Delete "../node_modules/bootstrap/dist/css/bootstrap

Multiple Angular Elements from different scripts

跟風遠走 提交于 2019-12-02 00:47:05
Is it possible to use Angular Elements generated from diffrent scripts? I have 2 projects weather-widget and clock widget which generates their own script(concated all required ones). When I use these widgets individually it works fine but when these are used on same page it gives error shown as below: DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at CustomElementRegistry.define (http://172.27.147.64:8080/node_modules/document-register-element/build/document-register-element.js:2:18538) at new AppModule (http://172.27