Reputation: 356
I want to serve a page that already has data populated from PHP, and use AngularJS to edit and update this data, but initially I don't want to load the data into AngularJS.
Is there a way to disable data binding on load so that AngularJS doesn't replace the data that's already there, but enable it later when I edit some data and want to update the element?
Upvotes: 1
Views: 537
Reputation: 3055
You can use the ng-init
attribute. This post describes how you can use it.
Upvotes: 0
Reputation: 10764
May be you should to populate the template only using angularjs. Why would you want duplicate work by doing serverside templating and client side templating? I agree with @tymeJV. It is very un-Angular-y,
Or if you really want, you would want to have an init_function
inside the angularjs controller that will be called only on edit and will load data when it does that. But I am not very convinced
Upvotes: 1