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,

1

1 Answer 1

1

I believe you can just include it in menu.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.