在services.js里,我创建了一个一个service叫http_handle:
.service('http_handle', function($rootScope,$ionicPopup,$http,$ionicModal,ionicToast) {
var self =this;
self.handle= function (data,$scope) {
if (data.err) {
alert(data.err.message);
return;
}
};
});
然后我想在另一个js文件的一个函数里调用到http_handle的handle这个方法:(注:这只是一个普通的js文件,在angular的框架范围之外)
function callback(type, data) {
alert(type+" " + data);
//调用http_handle.handle
}
可以如何才能获取到http_handle这个service对象呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
人生最曼妙的风景,竟是内心的淡定与从容!