ionic-native-transitions
ionic-native-transitions copied to clipboard
[$injector:unpr] Unknown provider: $ionicNativeTransitionsProvider
I got this very strange error....
Error: [$injector:unpr] Unknown provider: $ionicNativeTransitionsProviderProvider <- $ionicNativeTransitionsProvider
I'v used
ionic plugin add https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.6.2
imported the ionic-native-transitions.min.js
from github and put it in the index.html file
I added 'ionic-native-transitions' as dependency in app.js
angular.module('myapp.external', ['ionic-native-transitions']);
angular.module('myapp', ['myapp.external']);
but I got this error.... any idea? thank you
Make sure the ionic-native-transitions file is correctly injected in your app.
sorry, what do you mean? I have the .js file in my path, and imported it in .index.html. I use $ionicNativeTransitionsProvider only as directive and in state, as
.state('poi', { url: '/poi', templateUrl: 'templates/poi.html', nativeTransitions: { "type": "flip", "direction": "up" }, controller: 'descriptionPanelController', controllerAs: 'descCtrl' })
so I guess shouldn't inject it anywhere else.
missing $ionicNativeTransitionsProvider
either means that the script is not injected in the page or that it is not added as a dependency.
Which version are you using?
ionic plugin add https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.6.2
and the imported .js file says
/*!
* ionic-native-transitions
* ---
* Native transitions for Ionic applications
* @version: v1.0.0-rc10
* @author: shprink <[email protected]>
* @link: https://github.com/shprink/ionic-native-transitions
* @license: MIT
*
*/
then in my app.js I have something like:
.config(function($ionicConfigProvider, $ionicNativeTransitionsProvider) {
$ionicConfigProvider.views.transition('none');
$ionicNativeTransitionsProvider.enable(true);
$ionicNativeTransitionsProvider.setDefaultOptions({ /* options */ });
it works... sorry, I was injecting '$ionicNativeTransitionsProvider' also in app.run(). I removed the dependency from .run() and now it works.
I am also facing same issue when include $ionicNativeTransitionsProvider in config. All the default transition options are working fine without adding this provider but when trying to override and include it start giving unknown provider.
Using bower I have include ionic-native-transitions.js in index html Add 'ionic-native-transitions' in app js Transition works fine when add nativeTransitions in routes e.g.
.state('app.intro', {
url: '/intro',
nativeTransitions: {
"type": "fade",
"duration": "300"
}
})
Unknown provider error when
.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider, $ionicNativeTransitionsProvider) {
Using ionic driftyco/ionic-bower#1.0.0
Any idea?