0

I'm using Express to serve Angular templates and scripts. My public/views/index.html is:

<!doctype html>
<html lang='en'>
<head>
</head>

<body>
    <div ng-app='eventsApp' ng-controller='EventController'>
        {{event.name}} <br />
        {{event.location}} <br />
    </div>


    <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js'></script>
    <script src='javascripts/app.js'</script>
</body>
</html>

and my public/javscripts/app.js is:

(function() {
  var EventController, eventsApp;

  eventsApp = angular.module('eventsApp', []);

  EventController = function($scope) {
    return $scope.event = {
      name: 'angular bootcamp',
      location: 'SF'
    };
  };

  eventsApp.controller('EventController', EventController);

}).call(this);

But my webpage just shows

{{event.name}} 
{{event.location}} 

without substituting the values. What am I missing?

4

1 回答 1

0

只是语法错误。只需关闭您的第二个脚本标签。

于 2013-10-02T05:29:41.953 回答