javascript - How to include custom directive to another custom directive's template(html) in angular js -


i hava directive already(appview) , has html load through templateurl. of now, need add 1 more custom directive template being used directive(appview).

please see code below , not working expected. on how can make work please?

view.html (template)

<div>     <div class="dragdrop" id="dropzone" dropzone> //here custom directive         <div class="fileupload btn btn-primary">         <span>upload assets</span>         <input id="dzfile" type="file" class="upload" />         </div>      </div> </div> 

angular js

var appmodule = angular.module("newapp", []);  appmodule.directive("appview", appview); function appview(){     var directive = {         restrict: 'e',         templateurl: 'app/view.html'     };     return directive; }  appmodule.directive("dropzone", function(){  //this added view.html attribute(see above html code **)     var directive = {         restrict: 'a',         link: fulldragdrop     };     return directive; });  function fulldragdrop(){     console.log("soemthing goes here"); } 

how can make possible please?

this code works me. make sure templateurl: 'app/view.html' exists

<script>  var appmodule = angular.module("newapp", []);      appmodule.directive("appview", appview);          function appview(){              var directive = {                 restrict: 'e',                 templateurl: 'view.html'             };              return directive;        }        appmodule.directive("dropzone", function(){  //this added view.html attribute(see above html code **)            var directive = {                 restrict: 'a',                 link: fulldragdrop             };              return directive;      });         function fulldragdrop(){          console.log("soemthing goes here");      }   </script>  <script type="text/ng-template" id="view.html">    <div class="dragdrop" id="dropzone" dropzone> //here custom directive           <div class="fileupload btn btn-primary">           <span>upload assets</span>           <input id="dzfile" type="file" class="upload" />           </div>        </div> </script>  <body>   <app-view></app-view> </body> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -