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 -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -