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

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -