I am using 'angular2-virtual-scroll' to implement load on demand. The items used to be driven by observable's using the async pipe triggered by the parent component. Now i am trying to call my service from the child. The call is successfu...
I am trying to create a simple example project to test the angular 2 change detection mechanism: I create a pure javascript object in script tags on the main index page. it contains the following:          var Tryout = {};         Tryout.text = "...
I have a public method that I exposed to window. This method talks to a Component and modifies a variable I am watching in my template. But when I change the value, the *ngIf() does not get triggered.  app.component  constructor(private _public: Publ...
I'm testing an option to display/hide div based on boolean value from an observable. Based on the second answer provided from this stack question, I have the following code which collects the document body width and the returned value is used wit...
I have a simple Attribute Directive mask, with an @Input() mask:string  I want to be able to detect and react to changes on the mask binding I can use ngOnChanges somehow, but I feel like this is like painting the problem with a large brush  Sample/S...
I have an HttpClient service which is updating the data at backend. During the processing at backend, I' am displaying a loading state by doing this.isLoading = true, and after the successfully processing, I' am removing that loading state in...
For example, there is an element in the template using a local variable #targetElement which aims to get its current width whenever it needs. But I don't want to programmatically calculate the style. Tried with a setter with @ViewChild annotation...
Consider this plunker  @Component({   changeDetection: ChangeDetectionStrategy.OnPush,   selector: 'my-app-n1',   template: `     <my-app-n2 [from2]="from1"></my-app-n2>     <div>       {{from1.name}}       <input...
I'm trying to fire an event when my component gets the logged user from a service because I would like to show the navigation bar only when a user is logged in.  Here's my app.component code:  import { Component, OnInit, EventEmitter, Input,...
I met a very interesting in my angular2 application, I simplify the situation here.  This is AppComponnet  export class AppComponent {      tabs: any = [];      viewModes = [        { label: "????"},        { label: "???" },     ];...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.