$scope.on($ionicView.enter and $cordovaBarcodeScanner.scan()


#1

hello,
i need to lunch the barecode scanner on View enter.

i tray some thing like :
$scope.$on( “$ionicView.enter”, function( scopes, states ) {
$cordovaBarcodeScanner.scan().then(function (result) {
$rootScope.result = result;
});
});

any suggestion?
thanks