angularjs - Compile angular directive dynamically -


if add angular material directive md-button :

angular.element( document.body ).append( '<md-button> material' ) 

it not recognize it's angular directive. question - how recompile scope/element

not sure if should doing this, right way use $compile function:

angular.element(document.body).append($compile('<md-button> material')($scope)) 

working plunker.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -