angular-cordova
angular-cordova copied to clipboard
docs not found
hi, it seems that the documentation link is not working: http://mgcrea.github.io/angular-cordova
best, dan
For now, that's still work in progress ;-), I'll add the docs in the coming weeks. Thanks!
thanks!
How's it coming?
I like where you're going with this library. Is there any documentation available yet?
+1
When it is coming?
When it is coming?
When it is coming?
NOTE: This is a wrapper of the Cordova API. Read documentation for more information.
Angular Cordova
Module: mgcrea.ngCordova.exec
Service: $cordova
Excample:
angular
.module('myApp', ['mgcrea.ngCordova'])
.controller('myCtrl', ['$cordova', function($contacts) {}]);
Methods:
Exec
$cordova.exec(plugin, action, args)
Handle Open Url
$cordova.handleOpenURL(scheme, callback)
$ Open Url
$cordova.$open(url)
Is Ready
$cordova.isReady()
Destroy
$cordova.destroy()
On Device Ready
$cordova.onDeviceReady()
Cordova Analytics
Module: cordova.analytics
Service: $analytics
Excample:
angular
.module('myApp', ['cordova.analytics'])
.controller('myCtrl', ['$analytics', function($analytics) {}]);
Methods:
Init
$analytics.init(id, period)
- id = the GA account ID of the form 'UA-00000000-0'
- period = the minimum interval for transmitting tracking events if any exist in the queue
Track Event
$analytics.trackEvent(category, eventAction, eventLabel,eventValue)
- category = The event category. This parameter is required to be non-empty.
- eventAction = The event action. This parameter is required to be non-empty.
- eventLabel = The event label. This parameter may be a blank string to indicate no label.
- eventValue = The event value. This parameter may be -1 to indicate no value.
Track Page
$analytics.trackPage(url)
- url = the URL of the page view
Set Variable
$analytics.setVariable(index, value)
- index = the numerical index of the dimension to which this variable will be assigned (1 - 20)
- value = the value of the variable you are logging
Destroy (? Variable ?)
$analytics.destroy(index, value)
Cordova Contacts
Module: cordova.contacts
Service: $contacts
File: cordova-contacts.js
Excample:
angular
.module('myApp', ['cordova.contacts'])
.controller('myCtrl', ['$contacts', function($contacts) {}]);
Methods:
Save
$contacts.save(contact)
- contact
Find
$contacts.find(contact)
- options
Cordova Notification
File: cordova-notification.js
Module: mgcrea.ngCordova.notification
Service: $notfication
Excample:
angular
.module('myApp', ['mgcrea.ngCordova.notification'])
.controller('myCtrl', ['$notification', function($notification) {}]);
Methods:
Alert
Open a native alert dialog, with a customizable title and button text.
$notification.alert(title, message, buttonLabel)
- title [string] Title of the alert dialog (default: 'Alert')
- message [string] Message to print in the body of the alert (default: '')
- buttonLabel - [string] Label of the close button (default: 'OK')
Confirm
Open a native confirm dialog, with a customizable title and button text. The result that the user selects is returned to the result callback.
$notification.confirm(title, message, buttonLabels, submitButton)
- title [string] Title of the alert dialog (default: 'Confirm')
- message [string] Message to print in the body of the alert (default: '')
- buttonLabels - [Array] Label of the close button (default: ['OK', 'Cancel'])
- submitButton - [int] Button as submit 1 or 2 (default: 2)
Prompt
Open a native prompt dialog, with a customizable title and button text. The following results are returned to the result callback:
- buttonIndex Index number of the button selected.
- input1 The text entered in the prompt dialog box.
$notification.prompt(title, message, buttonLabels, submitButton)
- title [string] Title of the alert dialog (default: 'Prompt')
- message [string] Message to print in the body of the alert (default: '')
- buttonLabels - [Array] Label of the close button (default: ['OK', 'Cancel'])
- submitButton - [int] Button as submit 1 or 2 (default: 2)
Vibrate
Causes the device to vibrate.
$notification.vibrate(time)
- time [int] The number of milliseconds to vibrate for. (default: 1000)
Beep
Causes the device to beep. On Android, the default notification ringtone is played "count" times.
$notification.vibrate(count)
- time [int] The number of beeps. (default: 1)
Cordova Push Notification
File: cordova-push-notification.js
Module: cordova.pushNotification
Service: $pushNotfication
Excample:
angular
.module('myApp', ['cordova.pushNotification'])
.controller('myCtrl', ['$pushNotfication', function($pushNotfication) {}]);
Methods:
Register Device
Register for push notifications and retreive a deviceToken
$pushNotfication.registerDevice(options)
Get Pending Notifications
Retreive pending notification received while the application is in background or at launch
$pushNotfication.getPendingNotifications()
Get Remote Notification Status
Get a detailed status of remoteNotifications
$pushNotfication.getRemoteNotificationStatus()
Get Application Icon Badge Number
Get the current value of the application badge number
$pushNotfication.getApplicationIconBadgeNumber()
Set Application Icon Badge Number
Set the application icon badge
$pushNotfication.setApplicationIconBadgeNumber(value)
- value [int] value of badge number (default: 0)
Cancel All Local Notifications
Clear all notifications from the notification center
$pushNotfication.cancelAllLocalNotifications()
Cancel All Local Notifications
Call this to retreive the iOS6 device unique id
$pushNotfication.getDeviceUniqueIdentifier()
Cancel All Local Notifications
$pushNotfication.notificationCallback(notification)
- notification [function] the push notification
Cordova Splash Screen
File: cordova-push-splashscreen.js
Module: mcgrea.ngCordova.splashscreen
Service: $splashscreen
Excample:
angular
.module('myApp', ['mcgrea.ngCordova.splashscreen'])
.controller('myCtrl', ['$splashscreen', function($splashscreen) {}]);
Methods:
Show
Show the native splashscreen
$splashscreen.show()
Hide
Hide the native splashscreen
$splashscreen.hide()
@soslan2002 give him a break and read the source code.