Modules and namespace / name collision in AngularJS

前端 未结 4 1969
故里飘歌
故里飘歌 2020-11-30 05:41

Consider the following jfiddle http://jsfiddle.net/bchapman26/9uUBU/29/

//angular.js example for factory vs service
var app = angular.module(\'myApp\', [\'mo         


        
4条回答
  •  醉酒成梦
    2020-11-30 06:09

    Define your controllers on the module you want the service to be from.

    service2Module.controller("ServiceTwoCtrl", function(myService, $scope) {});

提交回复
热议问题