Skip to content

MyBestPro/angular-mybestpro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-mybestpro

AngularJS module integrate MyBestPro elements

Installation

Load the module

angular.module('myApp', [
    'MyBestPro'
]);

Provider MBPLog

Configuration

Set the log level

angular.module('myApp')
    .config(['MBPLogProvider', function (MBPLogProvider) {
        MBPLogProvider.setLevel(MBPLogProvider.LOG_DEBUG);
    }]);

Available values :

  • LOG_INACTIVE
  • LOG_ERROR
  • LOG_WARNING
  • LOG_INFO
  • LOG_LOG
  • LOG_DEBUG

Usage

MBPLog.info('My info');
MBPLog.error('My error');
MBPLog.log('My log');
MBPLog.warn('My warn');

MBPLog.time('timerName');
// ...
MBPLog.timeEnd('timerName');

This module provides a directive to show log :

<mbp-log></mbp-log>

The "showing status" is managable with the method :

MBPLog.setDisplayMode(true);

Provider IndexedDB

TODO

MBPNotificationPush

Use the Phonegap Plugin : https://github.com/phonegap/phonegap-plugin-push

Configuration

Example :

angular.module('myApp')
    .config(['MBPNotificationPushProvider', function (MBPNotificationPushProvider) {
        MBPNotificationPushProvider.setConfiguration({
            android: {
                senderID: 'XXXXXXXXX',
                icon: 'notification',
                iconColor: 'purple',
                sound: true,
                vibrate: true,
                clearNotifications: true,
                forceShow: false,
                topics: []
            },
            ios: {
                senderID: '',
                alert: false,
                badge: false,
                sound: false,
                clearBadge: false,
                gcmSandbox: false,
                topics: [],
                categories: {}
            },
            windows: {}
        });
    }]);

For more detail, take a look at https://github.com/phonegap/phonegap-plugin-push

Usage

Events :

MBPNotificationPush.init()
    .then(function() {
        MBPNotificationPush.onRegistration(function(data) {
            // do what you want with data
        });
        MBPNotificationPush.onNotification(function(data) {
            // do what you want with data
        });
        MBPNotificationPush.onError(function(data) {
            // do what you want with data
        });
    });

About

AngularJS module integrate MyBestPro elements

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors