When using ANGULARJS, you want to build angular templates dynamically and show them through angular.
Here's how to use it:
<HTMLNg-app= "App"><Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <Scriptsrc= "Assets/angular.min.js"></Script> <Scriptsrc= "Assets/js/jquery.min.js"></Script> <Scriptsrc= "Assets/js/handlebars.min.js"></Script> <Scriptsrc= "Assets/handlebars.helper.js"></Script> <Script> varapp=Angular.module ("app",[]); App.controller ('Ctrl', ['$scope','$compile',function($scope, $compile) {$scope. UserName='RAY'; $scope. Test= functionTest () {Console.log ('Hello:' +$scope. UserName); } //dynamically compiling HTML via $compile varHTML="<button ng-click= ' Test () >{{userName}}</button>"; varTemplate=angular.element (HTML); varmobiledialogelement=$compile (template) ($scope); Angular.element (document.body). Append (mobiledialogelement); }]); </Script></Head><BodyNg-controller= "Ctrl"> </Body></HTML>
var HTML = " <button ng-click= ' Test () >{{userName}}</button> " ;
This code is the angular template, compiled by the Angularjs compiler, to access the object data in the angular scope.
ANGULARJS Dynamic compilation added to the DOM