I have a controller for my navigation bar because it will be on some pages and not others. This is the markup for the navigation bar:
<html ng-app="myApp">
<head>
<title> My layout.html </title>
</head>
<body>
<nav ng-controller="NavCtrl">
I have this NAVBAR
</nav>
<div ui-view></div>
</body>
</html>
Normally, I would specify the name of my controller in my routes like this:
$stateProvider.state('/', {
controller: 'NavbarCtrl'
});
But in this case, I don't have a route that corresponds to my nav bar, I just have my navbar controller file itself. My question is: how can I register the controller without a templateUrl via ui-router?
.controller('NavCtrl', function($scope) { .... })