In angular1, we call the function ng-init based on ng-if condition. The following code represents If first div match with date && time then it will check the second
You can use ngOnInit method in your component class but remember to implements the OnInit interface.
Here's an example:
@Component({ selector: 'ramadan', template: `Ramadan` }) class Ramadan implements OnInit { ngOnInit() { this.play(); } }
You can fin more about ngOnInit here.