I'm using angularjs 1.6.6 - and using gulp.
This is my current codes.
e.g.: AppLayout component
/// app-layout.component.js
angular.module('app').component('appLayout', {
templateUrl: 'components/app-layout/app-layout.html',
controller: 'AppController as $ctrlApp'
});
/// app-layout.controller.js
function AppController($rootScope, $interval) {
this.timeNow = new Date();
$interval(function() {
this.timeNow = new Date();
}, 1000);
};
// app-layout.html
<div ui-view="" class="main-wrapper"></div>
what's the wrong? I can't see any answers about this.
Try to use 'controllerAs' property instead: