mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-07 14:53:17 +08:00
note about ng1 observables
This commit is contained in:
parent
06c749ffab
commit
53b6d813d5
17
README.md
17
README.md
@ -49,6 +49,23 @@ angular.module('myApp', ['ionic', 'ionic.native'])
|
||||
});
|
||||
```
|
||||
|
||||
For services that return observables, the Angular 1 digest cycle must be done manually (currently):
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ionic', 'ionic.native'])
|
||||
|
||||
.controller('MyCtrl', function($scope, $cordovaGeolocation) {
|
||||
$scope.takePicture = function() {
|
||||
$cordovaGeolocation.watchPosition(opts).subscribe(function(p) {
|
||||
$scope.$apply(function() {
|
||||
$scope.position = p.coords;
|
||||
});
|
||||
}, function(err) {
|
||||
});
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
### Runtime Diagnostics
|
||||
|
||||
Spent way too long diagnosing an issue only to realize a plugin wasn't firing or installed? Ionic Native lets you know what the issue is and how you can resolve it.
|
||||
|
Loading…
Reference in New Issue
Block a user