0

I am trying to create a login page and I have the html looking how I want it so now I am trying to create a controller but for some reason the js controller isnt working with the html. here is the plunker. The {{name}} data bind should display world but it isnt. Here is the controller:

(function() {
    "use strict";
    var app = angular.module('plunker', []);

    app.controller('LoginController', function($scope) {
        $scope.name = 'World';
    });

})();

http://plnkr.co/edit/mqc6ksw1xo7NMhj74Noa?p=preview

Siguza
  • 21,155
  • 6
  • 52
  • 89

2 Answers2

3

The issue is your angularjs link is not working , just replace with this,

  <script data-require="angular.js@*" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular.min.js"></script>

Working code

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
0

You have the wrong link so it can't load angular, change

https://code.angularjs.org/2.0.0-alpha.31/angular.js

to

https://code.angularjs.org/2.0.0-alpha.31/angular2.js

note the extra '2' at the end

Tim
  • 41,901
  • 18
  • 127
  • 145