Hello, I'm starting in Angular Js, and I'm doing a project in Single Page Application, in my index, I load some scripts and my ng-view, but in one of my partials, I need to load a script into it, it does not make sense to load directly into the index , because I need DOM elements that are in my view, and would be an unnecessary loading because not all users will reach this view. But I realized that the scripts inside partials are not executed. Could someone give me some help, follow my index, main and partial codes. Thank you.
Index.html
<html lang="pt-br" ng-app="sistema">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Index.html</title>
<script src="/js/lib/angular.min.js"></script>
<script src="/js/lib/angular-route.min.js"></script>
<script src="/js/lib/angular-resource.min.js"></script>
<script src="js/main.js"></script>
<link href="/css/style.min.css" rel="stylesheet" />
<script src="/js/lib/jquery.min.js"></script>
</head>
<body>
<ng-view></ng-view>
</body>
</html>
Partial.html
<script src="caminho-do-meu-script.js"></script>
<script>
$(document).ready(function(){
alert("aqui meu script inline");
});
</script>
<h1>Minha partial com scripts</h1>
Main.js
angular.module('sistema', ['ngRoute', 'ngResource'])
.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.when('/teste', {
templateUrl: 'partials/partial.html'
});
$routeProvider.otherwise({redirectTo: '/teste'});
});