angularjs shared service $shared服务避免直接使用$rootScope
angularjs共享服务$shared服务避免直接使用$rootScope基本用法获取/设置$shared . set ( 'someKey' , 'hello!' ) $shared . get ( 'someKey' )手表$shared . watch ( 'someKey' , function ( newVal ) { alert ( newVal ) ; } ) ;发射/开启$shared . on ( $scope , "someSignal" , function ( event , data ) { alert ( data ) } ) ; $shared . emit ( "someSignal" , "someMessage" ) ;
用户评论