Angularjs on page load call function

后端 未结 7 540
臣服心动
臣服心动 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:43

    Instead of using onload, use Angular's ng-init.

    Note: This requires that myFunction is a property of the CinemaCtrl scope.

提交回复
热议问题