lundi 8 août 2016

Why is AngularJS Controller not working on my pc?

I have started learning MEAN Stack and wanted to try some code but AngularJs Controller is not working on my PC. I have windows 10 on my Acer Aspire V Nitro.

Can anyone please help. Will be highly obliged.

My code - (index.html)

<!DOCTYPE html>
<html ng-app="appname">

  <head>
    <script src="angular.min.js"></script>
    <link href="style.css" rel="stylesheet"/>
    <script src="script.js"></script>
  </head>

  <body>
    <div ng-app="appname" ng-controller="appCtrl">
      <p>, world </p>
    </div>
  </body>

</html>

(app.js)

var appname = angular.module('appname', []);
appname.controller('appCtrl', ['$scope',
  function($scope) {
    $scope.greeting = { text: 'Hello' };
}]);

Both the files are in C://test folder.

Thank You.

Aucun commentaire:

Enregistrer un commentaire