Angularjs on page load call function

后端 未结 7 480
臣服心动
臣服心动 2021-01-14 10:09

I am learning AngularJS. I have some article tag and on clicking on a button each article page is showed without any page refresh. This is one page website. Wha

7条回答
  •  逝去的感伤
    2021-01-14 10:32

    you can also use the below code.

    function activateController(){
         console.log('HELLO WORLD');
    }
    
    $scope.$on('$viewContentLoaded', function ($evt, data) {
        activateController();
    });
    

提交回复
热议问题