0

I am working with AngularJs and i have a doubt.

This is my html code:

<header id="menu" ng-include="'pages/menu.html'"></header>
<main>
    <!-- Aquí inyectamos la vista -->
    <div ng-view></div>
</main>

I want to load a js file for the menu.html file, how could do it?

Have i to create a directive ng-controller in the header with id="menu"? or can i associate a js inside my menu.html file?.

I have a file js main with the routing app (main.js), but i would like to load a separate js file (menu.js) for menu.html file.

Thanks,

Eladerezador
  • 1,277
  • 7
  • 25
  • 48
  • 1
    you can check this: http://stackoverflow.com/questions/23656231/angularjs-dynamic-loading-of-external-js-based-on-routes – Armen Dec 29 '15 at 11:22

1 Answers1

1

I believe you can just include it in menu.html

Mike Jerred
  • 9,551
  • 5
  • 22
  • 42