var app = angular.module("myApp", [], function($provide) {
console.log(33);
//可以定义多个服务
$provide.provider("CustomServise", function() {
this.$get = function() {
return {
message: "CustomServise message"
}
}
})
});
app.controller("mycontroller", function($scope, CustomServise) {
$scope.name = "黎兴英";
console.log(333, CustomServise)
})
provider的使用
最新推荐文章于 2025-06-24 16:25:21 发布