javascript - AngularJS - dynamically add a template and invoke corresponding controller -



javascript - AngularJS - dynamically add a template and invoke corresponding controller -

i want append template when user presses button. want invoke corresponding controller. unfortunately dont have thought how to that.

can help?

you can append template , create new scope for. afterwards need compile in order invoke controller.

so after have appended template:

var new_scope = $scope.$new(); $compile( $tmpl ) ( new_scope );

that invokes controller

javascript angularjs single-page-application

Comments

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -