Is it possible to dynamically change global stylesheets in Angular 2?

Is it possible to dynamically change global stylesheets? EDIT: The purpose is to allow the user to pick the styles he prefers. In Angular 1, I was able to wrap a controller around the head tag and use bindings in there. Example below (simplified code): index.html <!DOCTYPE html> <html ng-app=”app” ng-controller=”AppController”> <head> <title>Title</title> <link rel=”stylesheet” … Read more

Angular 2 RC 5 Attempting to Get and Display a PDF from a Server

I am trying to display a PDF that is generated from a server onto a view in my Angular 2 RC 5 project. Right now, the ASPNETCORE server is returning the object as an ‘application/pdf’ and the Angular client is trying to parse the response as a blob. However, I get the following error on … Read more

angular 4 how to access ViewChildren _results

i have a list of checkboxes inside an ngFor: <md-checkbox #hangcheck [id]=”hangout?.$key” class=”mychecks” > I’m Interested </md-checkbox> i refrence them in the component like so: @ViewChildren(“hangcheck”) hangchecks: QueryList<any>; then in ngAfterViewInit i need to loop them: ngAfterViewInit(){ console.log(‘the array: ‘,this.hangchecks) this.hangchecks._results.forEach((item) => { console.log(‘the item: ‘,item) }); } but i get: Property ‘_results’ is private … Read more

Force routerlink to refresh component

I have created a very basic angular 5 application. I have a left menu which is always displayed (it is part of core2.0 mvc project skelton with bootstrap). I have created 2 links in this menu: <li> <a [routerLink]='[“/component/1”]’>Component 1</a> </li> <li> <a [routerLink]='[“/component/2”]’>Component 1</a> </li> As you can see, the 2 links points … Read more

Rendering the components in ContentChildren of Angular

This is my component: import { Component, OnInit, ContentChildren, QueryList } from ‘@angular/core’; import { IconBoxComponent } from ‘../icon-box/icon-box.component’; @Component({ selector: ‘app-three-icon-box’, templateUrl: ‘./three-icon-box.component.html’, styleUrls: [‘./three-icon-box.component.scss’] }) export class ThreeIconBoxComponent implements OnInit { @ContentChildren(IconBoxComponent) boxes: QueryList<IconBoxComponent>; constructor() { } ngOnInit() { } ngAfterContentInit() { console.log(this.boxes); } } Its template looks like this: <div class=”row justify-content-center”> … Read more

Display a simple alert dialog in Material Angular

I’m using Material Angular (from Angular Material). The examples in the site seem a Little too overcomplicated and every other tutorial in the internet seems either outdated or to be using AngularJS instead. How can I show a simple alert (just like Android’s AlertDialog) with a title, a message and a confirm/cancel button? Answer EDIT: … Read more

BrowserslistError: Unknown version 67 of android

I have created one angular library using angular 8 and CLI 8. I am trying to build the library, but I am getting the error. ng build <lib-name> I have gone through some questions posted related to this error, most of them say remove node_modules and reinstall them. I tried this solution but still, I … Read more

Angular2: How to find out what was previous page url when using angular2 routing [duplicate]

This question already has answers here: How to determine previous page URL in Angular? (19 answers) Closed 1 year ago. I am developing an angular2 app and I use router. I am in a page /myapp/signup. after signup I navigate the use to /myapp/login. /myapp/login can also be navigated from my home page which is … Read more

Passing objects in routing [duplicate]

This question already has answers here: How do I pass data to Angular routed components? (18 answers) Closed 3 years ago. I have a component in Angular2 hosting the table of users (userTableComponnent) and another component of userDetails. Upon clicking on a row in users table, I want to route to the userDetails. One implementation … Read more