AngularJS ui-router
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.0/angular-ui-router.js"></script>
<div ui-view class="top">
myPage
</div>
JavaScript
/* myApp module */
var myApp = angular.module('myApp', ['ui.router'])
.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('home', {
url: "",
template: '<div></div>',
});
}])
.controller('anotherController', function ($scope, $state) {
let vm = this;
this.someFunction = function(myParam){
console.log(myParam);
}
})
.controller('MyAppCtrl', function ($scope, $state, anotherController) {
anotherController.someFunction('hello controller 2');
});