angular - Angular2 Modal updated, but view is not updating -


created component named notification.component.ts

import { component, oninit } '@angular/core';  @component({   selector: 'notification',   templateurl: './notification.component.html',   styleurls: ['./notification.component.css'] }) export class notificationcomponent implements oninit {    constructor() { }    private type:string = "";   private message:string = "";   private showmessage:boolean = false;    ngoninit() {       //this.showmessagebox('info', 'hi da');   }    showmessagebox = (type:string, message:string): void => {       this.type = type;       this.message = message;       this.showmessage = true;   }  } 

and template below

<div id="notification" class="boxshadow" *ngif="showmessage" >     <b>{{type}}! </b>{{message}} </div> 

i have called showmessagebox() function other component. model updated, view not updating. pfb component below

import { component, oninit, viewencapsulation, inject } '@angular/core'; import { messages } '../shared/classes/messages'; import { notificationcomponent } '../shared/notification/notification.component'; @component({     selector: 'app-estimation-gating',     templateurl: './estimation-gating.component.html',     styleurls: ['./estimation-gating.component.css']     providers: [] })  export class estimationgatingcomponent implements oninit {      constructor( private messages: messages, private n:notificationcomponent) {         //alert(messages.gating.gating_saved);         n.showmessagebox('info', messages.gating.gating_saved);     }      } 

please me fixing issue.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -