How to run AngularJS example

前端 未结 3 661
借酒劲吻你
借酒劲吻你 2021-01-12 15:41

I\'ve done as described here: http://docs.angularjs.org/tutorial/step_00 but can\'t run the phonecat example as AngularJS. It runs like a bunch of html files. For example, t

3条回答
  •  我在风中等你
    2021-01-12 16:29

    I had the same problem. When loading angular with reguirejs, you have to remove the ng-app directive from the html and add it after calling angular.bootstrap(document, ['myApp']) like this:

    $(html).addClass('ng-app');

    Check this seed project out: https://github.com/tnajdek/angular-requirejs-seed specifically index.html and app/js/main.js

提交回复
热议问题