mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-02 21:02:57 +08:00
Update README.md
This commit is contained in:
parent
2c01d1998f
commit
d3d14d0b86
18
README.md
18
README.md
@ -31,6 +31,24 @@ let watch = Geolocation.watchPosition().subscribe(pos => {
|
||||
watch.unsubscribe();
|
||||
```
|
||||
|
||||
### Angular 1
|
||||
|
||||
Ionic Native works as a stand-in for [ngCordova](http://ngcordova.com/). In many cases, the usage is identical, but we import `ionic.native` instead of `ngCorodva` as our module.
|
||||
|
||||
As a rule of thumb: take the ES6 class name of the plugin and add `$cordova` to get the service name. For example, `Geolocation` would be `$cordovaGeolocation`, and `Camera` will be `$cordovaCamera`:
|
||||
|
||||
```javascript
|
||||
angular.module('myApp', ['ionic', 'ionic.native'])
|
||||
|
||||
.controller('MyCtrl', function($scope, $cordovaCamera) {
|
||||
$scope.takePicture = function() {
|
||||
$cordovaCamera.getPicture(opts).then(function(p) {
|
||||
}, 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…
x
Reference in New Issue
Block a user