Spark
Spark

Reputation: 371

What's wrong with my Angular code?

My Html is here: -->

        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.10/angular.min.js"></script>
        <script type="text/javascript" src="app.js"></script>

        <title>Events Web</title>
    </head>
    <body ng-controller="LoginController">
        <p>{{name}}, world</p>
    </body>
    </html>

My app.js is here:

var app = angular.module('LoginPage',[]);

app.controller('LoginController',['$scope',
    function($scope){
        $scope.name = "100";
}]);

Can some one please help me with this? I tried a lot and couldn't find any mistake.

May be its a small one, but I couldn't find what's the issue

Upvotes: 0

Views: 60

Answers (1)

Sajal
Sajal

Reputation: 4401

You have forgot to add ng-app="LoginPage"

<html ng-app="LoginPage">
    <body ng-controller="LoginController">
         <p>{{name}}, world</p>
     </body>
</html>

See a basic example of Angularjs 1.3 setup - Sample

Upvotes: 4

Related Questions