mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore($ionicViewService): deprecate
This commit is contained in:
32
js/angular/service/viewService.js
vendored
Normal file
32
js/angular/service/viewService.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @private
|
||||
* DEPRECATED
|
||||
*/
|
||||
IonicModule
|
||||
.factory('$ionicViewService', ['$ionicHistory', '$log', function($ionicHistory, $log) {
|
||||
|
||||
function warn(oldMethod, newMethod) {
|
||||
$log.warn('$ionicViewService' + oldMethod + ' is deprecated, please use $ionicHistory' + newMethod + ' instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/');
|
||||
}
|
||||
|
||||
warn('', '');
|
||||
|
||||
var methodsMap = {
|
||||
getCurrentView: 'currentView',
|
||||
getBackView: 'backView',
|
||||
getForwardView: 'forwardView',
|
||||
getCurrentStateName: 'currentStateName',
|
||||
nextViewOptions: 'nextViewOptions',
|
||||
clearHistory: 'clearHistory'
|
||||
};
|
||||
|
||||
forEach(methodsMap, function(newMethod, oldMethod){
|
||||
methodsMap[oldMethod] = function() {
|
||||
warn('.' + oldMethod, '.' + newMethod);
|
||||
return $ionicHistory[newMethod].apply(this, arguments);
|
||||
};
|
||||
});
|
||||
|
||||
return methodsMap;
|
||||
|
||||
}]);
|
||||
Reference in New Issue
Block a user