Create User Define Directive in Angular Application

0
Create User Define Directive in Angular Application:-



Directive is used to provide predefine functionality under angular application we can create our own directive tag using directive();



app.module('modulename',[]).directive('directivename',function(){ return{ template :value}})



Example of Directive Elements of Angular JS:-
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script>
</head>
<body>
<div ng-app="myapp" ng-controller="myctrl">

<scs></scs>

</div>

<script>
angular.module('myapp',[]).directive('scs',function(){return {template:'<marquee>welcome in SHIVA Concept Solution</marquee>'}});



</script>
</body>
</html>

Tags

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)