📜  ionic 1 装饰器示例 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:38.110000             🧑  作者: Mango

代码示例1
angular.module("myAppName").decorator(                                            
        "$ionicActionSheet",                                                         
        function $ionicActionSheetDecorator( $delegate ) {                           
              var originalWarn = $delegate.show;                                     
              $delegate.show = function decoratedWarn(msg) {                         
                  alert("about to show");//do whatever you want here
                originalWarn.apply($delegate, arguments);                            
              };                                                                     
              return $delegate;                                                      
        }                                                                            
);