angularjs - Can't run angular app -


i'm trying run angularjs page. i've created controller not work.

i've reduced code as can spot problem can't found it, there 2 files:

index.html

<html np-app>   <head>     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>     <script src="main.js"></script>   </head>   <body ng-controller="runmectrl">{{hi}}</body> </html> 

main.js

function runmectrl($scope) {   console.log('running!!!');   $scope.hi="asjklfdkajsfkl"; }  console.log('script loaded'); 

the console logs script loaded, controller not invoked , don't know why. page displays "{{hi}}" in browser. no error shown.

any idea?

update:

angularjs loading correctly since can found angular object on javascript console:

> angular object {element: function, bootstrap: function, copy: function, extend: function, equals: function…} 

looks need switch np-app ng-app. :)


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -