0

Okay so I'm following an AngularJS online beginner course, and wrote my first app :

HTML :

<html ng-app>
  <head>
    <script src="lib/angular.min.js"></script>
    <script src="lib/app.js"></script>
  </head>
  <body>
    <div ng-controller="mainController">
      <h1>Hello {{ name }}!</h1>
    </div>
  </body>
</html>

app.js :

var myApp = angular.module("myApp",[]);
myApp.controller('mainController',['$scope',function($scope){
  $scope.name =  'Elliot';
}]);

I don't get the desired outcome from this small app, I only get "Hello {{ name }}!".

What am I doing wrong here?

1 Answer 1

2

Change your html tag too:

<html ng-app="myApp">
Sign up to request clarification or add additional context in comments.

1 Comment

I missed it! Thanks a lot! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.