ionic framework - Ionicframework, Trigger alert after state change -


All in the afternoon,

We are a little new, we have 'Cordova Barcode Scanner' without any problems And we scan the scan QR code and success does not trigger the information closing on state changes.

Anyone can see that what we are doing wrong will help in this massive scale.

Thanks

  Angular. Modules ('Starter Controllers', []) Controller ("Petindex", Function ($ Scope, $ Rootscope, $ State, $ Cordova Barcode Scanner) {$ scope.scanBarcode = function () {$ cordovaBarcodeScanner.scan ()} Then (function (result) {$ rootScope.barcoderesults = [{Result: result.text, format: result. Canceled, canceled, canceled: result canceled]]; $ state.go ('tab.pet-extension'); warning (result.text);}, Function (error) {warning ("scanning failed:" + error);});};});  

So you want to start tapping the event from Ui-Router.

  .controller ('RootCtrl', function ($ scope, $ ionic loading, $ timeout) {$ scope. $ On ('$ stateChangeStart', function (event, toState, To $ {$ IonicLoading.show}}} $ $ ('$ stateChangeSuccess', function (event, toState, toParam, fromState, fromParams) {$ timeout (function () {$ ionicLoading.hide () }}}}}}}}  

Then in this example, I'm just showing a loader when you changed the states, then the state change was successful after hiding


Comments