I am beginners for Angular2, I created a modal dialog, here is my HTML file. index.html file:-
<button type="button" class="btn btn-default" (click)="modal.open()">Open</button>
<modal #modal>
<modal-header [show-close]="true">
<h4 class="modal-title">I'm a modal!</h4>
</modal-header>
<modal-body>
Here i want to call show() method from .ts file.
</modal-body>
<modal-footer [show-default-buttons]="true"></modal-footer>
</modal>
After clicking on Open button I want to call show(){....}
that is inside .ts file
and I want to display inside <modal-boady></modal-body>
tag.
Here is my hello.component.ts file:-
import {Component, View} from "angular2/core";
@Component({
selector: 'my-app',
templateUrl: './index.html'
})
export class HeapMemoryGraphComponent implements OnInit {
constructor(){}
ngOnInit() {
this.show();
}
show(){
console.log("=====show()=======");
}
}
How could I do that? please guide me.
Thanks.