ngCordova
- 授权协议: MIT
- 开发语言: JavaScript
- 操作系统: 跨平台
- 软件首页: http://ngcordova.com/
- 软件文档: http://ngcordova.com/docs/
软件介绍
ngCordova 包含一组 AngularJS 的表达式,基于 Cordova API 构建,用于简化构建、测试和发布 Cordova 应用。
示例代码:
使用摄像头:
module.controller('PictureCtrl', function($scope, $cordovaCamera) {
$scope.takePicture = function() {
$cordovaCamera.getPicture({
// See all the possible Camera options from the Camera docs [1]:
/// https://github.com/apache/cordova-plugin-camera/blob/master/doc/index.md#cameraoptions
}).then(function(imageData) {
// Success! Image data is here
}, function(err) {
// An error occured. Show a message to the user
});
}
});
条形码扫描:
module.controller('MyCtrl', function($scope, $cordovaBarcodeScanner) {
$cordovaBarcodeScanner.scan().then(function(result) {
// Scanner result }, function(err) {
});
