javascript - AnguarJS won't even run $scope message -


having issue angular doesn't seem working @ in app.

trying run message on index page maincontroller, , won't run this.

jsfiddle: https://jsfiddle.net/cj5pe43k/1/.

html:

<body ng-app="app" ng-controller="maincontroller">      <div id="test" style="position:absolute;top:0;left:0;background:#000;width:100vw;height:100vh;color:#fff;display:flex;align-items:center;justify-content:center;"><p>{{message}}</p></div>      <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>  </body> 

js:

var app = angular.module('app', ['ngroute']);  app.config(function($routeprovider) {     $routeprovider      .when('/', {         templateurl: 'index.html',         controller: 'maincontroller'     })      .when('/', {         templateurl: 'pages/home.html',         controller: 'maincontroller'     }) })  app.controller('maincontroller', function($scope) {     $scope.message = 'main controller active'; }) 

after checking jsfiddle, seems including angular-ui-router, despite typing code ngroute. error returned fiddle little bit hidden clear: can't find ngroute module. , attached files having angular-ui-router included.

are following these steps? https://docs.angularjs.org/api/ngroute

if want include ui router, please have here instead: https://ui-router.github.io/ng1/docs/latest/index.html#/api/ui.router


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -