Wednesday, April 25, 2018

How to call Child Component Methods in Parent Component : ViewChild in Angular 2

How to call Child Component Methods in Parent Component : ViewChild



export class ParentComponent implements OnInit, DoCheck {

    @ViewChild(ChildComponent) child: ChildComponent;
SaveItems(){
this.child.ShowRecords();
}
}

export class ChildComponent implements OnInit, OnChanges {

ShowRecords() {
        this.isViewMode = true;
    }

}

No comments:

Post a Comment

Jquery Select and Change selector and event .How to Post data using jquery to mvc and web api action methods

Jquery :Change event in Jquery Method: Demo     $("#drpCountry").change(function () {             var id = $("#DrpCoun...