I am trying to load a script in my custom angular directive. Right now, it is simply adding script tag in DOM but it is not loading it.
angular.module(\'my
Something seems a little wrong here, but if you really wanted to do this you could just append a script tag to your directive's element:
app.directive('loadDirective', function() {
return {
restrict: 'E',
link: function($scope, $el) {
var script = document.createElement('script');
script.src = '//cdnjs.cloudflare.com/ajax/libs/emojione/1.3.0/lib/js/emojione.min.js'
$el.append(script);
}
}
});
Plunk