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
Post a Comment