I'm trying to create a singlepage angular application, but I don't know, how to load styles for particular controller view, if controller scope can only be applied in body element.
Here is the base layout of whole angular application:
<!DOCTYPE html>
<html ng-app="app">
<head>
<link href="/styles/some-basic-styles.css" rel="stylesheet" />
<script src="/scripts/angular.min.js"></script>
<script src="/script/custom/app.js"></script>
</head>
<ng-view></ng-view>
</html>
That app.js routing:
app.config(function ($routeProvider) {
$routeProvider
.when('/somepage', {templateUrl: 'views/someView.html', controller: 'someController'});
$routeProvider
.when('/anotherpage', {templateUrl: 'views/anotherView.html', controller: 'anotherController'});
});
An example view:
<body ng-controller="someController">
<!--some html code here-->
<script src="/scripts/someController.js"></script>
</body>
So, how can I change page title or add styles/scripts in my views if it's only accessible from global tamplate?
I think that I misunderstood something or I have to learn something else about angular, but what is that? Thanks for any help!