I am using angular 1.5 and angular-ui-router version 0.2.18
My app.js file looks like this:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import 'angular-ui-bootstrap';
import './components/logIn/logIn';
import './components/home/home';
angular.module('app', ['ui.bootstrap', 'app.components', uiRouter])
.controller('mainCtrl', function() {
})
.config(['$stateProvider', '$urlRouterProvider', '$urlMatcherFactoryProvider', function($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvider){
$urlRouterProvider
.when('/home', {
template: '<home></home>'
})
.otherwise({
redirectTo: '/home'
});
}]);
I get the following error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: invalid 'handler' in when() at $UrlRouterProvider.when (eval at (http://localhost:8080/app.bundle.js:511:2), :1916:13) at eval (eval at (http://localhost:8080/app.bundle.js:493:2), :20:22) at Object.invoke (eval at (http://localhost:8080/app.bundle.js:505:2), :4604:19) at runInvokeQueue (eval at (http://localhost:8080/app.bundle.js:505:2), :4497:35) at eval (eval at (http://localhost:8080/app.bundle.js:505:2), :4506:11) at forEach (eval at (http://localhost:8080/app.bundle.js:505:2), :321:20) at loadModules (eval at (http://localhost:8080/app.bundle.js:505:2), :4487:5) at createInjector (eval at (http://localhost:8080/app.bundle.js:505:2), :4409:19) at doBootstrap (eval at (http://localhost:8080/app.bundle.js:505:2), :1691:20)
I think it is the template
property. Is it not possible to set the templat like this?