I have a site that are using AngularJS and UI-Router. In order to have a separate login-page (that is not injected into the main view), I have separated the index.html (with both layout and scripts include) into an index.html (with only scripts include) and a layout.html (with only layout) as per AngularJS UI-Router multiple pages.
However my problem is that I have quite a lot of UI-logic in the script.js file (the theme is bought) and when I split up my index.html, then the UI elements in the scripts.js file, wont work in the layout.html file.
Index.html
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div ui-view></div>
<!-- Angular, JQuery and App specific scripts -->
<script src="script.js"></script>
</body>
</html>
Layout.html
<div>
<!-- Navigation layout that requires functions in script.js and some controller layout (showing currently logged in user) -->
<div ui-view></div>
</div>
I have created a Plunker to show my problem: http://plnkr.co/edit/O1G179cu5AZeVURxPgPq?p=preview
Is it possible to split up the index as I have, and still use the script.js file in layout?