Angularjs – Pass argument to directive
You can pass arguments to your custom directive as you do with the builtin Angular-directives – by specifying an attribute on the directive-element: angular.element(document.getElementById(‘wrapper’)) .append(‘<directive-name title=”title2″></directive-name>’); What you need to do is define the scope (including the argument(s)/parameter(s)) in the factory function of your directive. In below example the directive takes a title-parameter. You can … Read more