SHARE
TWEET
Untitled
a guest
Jan 11th, 2016
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- .controller('MainController', ['$scope', 'nfcService', function($scope, nfcService) {
- $scope.card = nfcService.uid;
- }])
- .factory('nfcService', function($rootScope, $ionicPlatform) {
- var uid = {};
- $ionicPlatform.ready(function() {
- nfc.addTagDiscoveredListener(function (nfcEvent) {
- var tag = nfcEvent.tag;
- var tagId = nfc.bytesToHexString(tag.id);
- $rootScope.$apply(function() {
- angular.copy(tagId, uid);
- });
- }, function () {
- //....
- }, function (reason) {
- //...
- });
- });
- return {
- uid: uid,
- };
- });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
