angular5

PrimeNG filter dropdown issue in scrollable turbo table

岁酱吖の 提交于 2019-12-11 02:47:33
问题 In prime-ng turbo table , when we put filter dropdown in scrollable table dropdown going inside the table Without scrollbale table dropdown works perfect. This works perfect but when scrollable table , dropdown is going inside the table Not works perfect. so I want to do dropdown outside the table not inside the table. This is a link https://primeng-table-bry1sl.stackblitz.io/ to see the code. Please see in 1024 resolution so you can see the scroll in the table and select one of the brand to

Disable future dates using angular-bootstrap-datetimepicker

江枫思渺然 提交于 2019-12-11 02:43:24
问题 I'm building a website in which the user has the ability to see some charts. Those charts are date-specific so the user needs to select the date for the chart to show up. Everything is working, but the user is allowed to select future dates. This shouldn't happen, because the charts are only for present and past dates. For the project I'm using Angular5 and for the date picker angular-bootstrap-datetimepicker and I can't seem to find the way to disable those date. The way I'm using the

Angular 5 - Ng-x spinner not showing when used in function

霸气de小男生 提交于 2019-12-11 02:26:36
问题 I am not sure if someone experiences this. Whenever I'm trying to use ngx-spinner in a function its not working. But when I put it inside the subscribed callback, it's working. Outside the authservice. This is not showing the spinner. login() { this._spinner.show(); //spinner call this._authService.login(this.user).subscribe( data => { sessionStorage.setItem("account", JSON.stringify(data[0].data)); sessionStorage.setItem("token", data[0].data.access_token); setInterval(() => { this._router

Pause Angular Animations

£可爱£侵袭症+ 提交于 2019-12-11 02:19:56
问题 Is it possible to pause animations in Angular 2+? I would like to pause an animation upon mousing over an element and resume the animation from where it left off when mousing out. I have created a simple script to demonstrate: https://stackblitz.com/edit/scrolling-text Here's my component: import { Component, ElementRef, ViewChild } from '@angular/core'; import { trigger, state, style, animate, transition } from '@angular/animations'; @Component({ selector: 'my-app', template: ` <div class=

AngularFire upload and get download URL

此生再无相见时 提交于 2019-12-11 01:56:23
问题 I'm trying to upload to my Storage bucket and then get the downloadURL to that uploaded file right after the upload is done. This was working previously but has since stopped for some reason. My console print is just returning null. I was hoping for a solution or even a better way of doing this. Any help would be awesome! I'm using Angular 5. Here is my current method: upload(event) { this.showProgressBar = true; const randomId = Math.random().toString(36).substring(2); this.ref = this

Custom filter not working in Angular Hybrid app

青春壹個敷衍的年華 提交于 2019-12-11 01:12:46
问题 I am attempting to convert an AngularJS 1.6 app in to a hybrid app along with Angular 5. I have the following simple filter defined: (function () { "use strict"; var filterId = "colorPicker"; angular .module('app') .filter('colorPicker', colorPicker); function colorPicker() { return function (input) { var colorCode = '#2980b9'; switch (input) { case 1: colorCode = '#16a085'; break; case 2: colorCode = '#a38761'; break; case 3: colorCode = '#8e44ad'; break; case 4: colorCode = '#ffa800'; break

How can i import external js file in Angular 5?

允我心安 提交于 2019-12-11 01:11:28
问题 I need to use external js in my angular 5 project. My example like this: https://codepen.io/sfdsfssdfdf/pen/opJpJM I added angular-cli.json file to this strings "styles": [ ... "../node_modules/jquery-minicolors/jquery.minicolors.css", "./assets/css/main.css", "./assets/css/style.css" **(i added style.css to css fold)" ], "scripts": [ ... "../node_modules/clipboard/dist/clipboard.min.js", "./assets/js/app.js", "./assets/js/index.js" **( i added index.js to js folder) ], and i added html codes

How to overwrite a component in Angular 5?

孤者浪人 提交于 2019-12-11 01:09:06
问题 I have a component <my-component> in Angular 5 @Component({ selector: 'my-component', templateUrl: './my.component.html', styleUrls: ['./my.component.css'] }) export class MyComponent { click(param: string){ console.log(param); } And in my html I have something like this: <my-component (click)="click('Hello world')"></my-component> I need to overwrite click function to execute: console.log('Param: ' + param); How can I do this??? 回答1: In your app.module.ts import { OriginalComponent } from '.

get user role from database based on user id in angular

泪湿孤枕 提交于 2019-12-10 23:51:19
问题 I am using an "auth service" to keep all the user authentication functions. When the user is authenticated, I get the user's id and I fetch the relevant record from the database table, but I fail to get the value of the "role" field. The code I am using in the constructor is this: constructor( private _firebaseAuth: AngularFireAuth, private db: AngularFireDatabase, private router: Router) { this.user = _firebaseAuth.authState; this.user.subscribe( (user) => { if (user) { this.userDetails =

How to perform caching http get request in angular 5?

百般思念 提交于 2019-12-10 23:25:56
问题 import { Injectable } from '@angular/core'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; import { catchError } from 'rxjs/operators'; @Injectable() export class ApiService { constructor(private http: HttpClient) { } // get API request public apiGetRequest(url: any): Observable<any> { return this.http.get(url) .pipe( catchError(this.handleError('apiGetRequest')) ); } } I am using angular 5 with rxjs version 5.5.6 I am trying to cache