Madhav Sharma

Madhav Sharma

  • 880
  • 899
  • 39.9k

Not getting output in custom directive in angular JS

May 22 2019 12:05 AM
  1. <html xmlns="http://www.w3.org/1999/xhtml">  
  2. <head>  
  3. <title>AngularJs Adding Directives to Modules Example</title>  
  4. <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>  
  5. <script>  
  6. var app = angular.module("myApp", [])  
  7. .controller("CustomDirectiveController"function ($scope) {  
  8. $scope.Message = "Custom Directive";  
  9. });  
  10. app.directive('myCustom'function () {  
  11. return {  
  12. templet: "<div>This is my first directive</div>",  
  13. }  
  14. })  
  15. </script>  
  16. </head>  
  17. <body ng-app="myApp">  
  18. <div ng-controller="CustomDirectiveController">  
  19. <div>  
  20. <my-custom></my-custom>  
  21. </div>  
  22. <p> <b>Using directive :</b> <span my-custom></span></p>  
  23. </div>  
  24. </body>  
  25. </html>  

Answers (1)