Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$injector:unpr] Unknown provider: $ionicNativeTransitionsProvider #86

Open
De-Lac opened this issue Apr 4, 2016 · 6 comments
Open

Comments

@De-Lac
Copy link

De-Lac commented Apr 4, 2016

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

@shprink
Copy link
Owner

shprink commented Apr 4, 2016

Make sure the ionic-native-transitions file is correctly injected in your app.

@De-Lac
Copy link
Author

De-Lac commented Apr 4, 2016

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.

@shprink
Copy link
Owner

shprink commented Apr 4, 2016

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?

@De-Lac
Copy link
Author

De-Lac commented Apr 4, 2016

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 <contact@julienrenaux.fr>
 * @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 */ });

@De-Lac
Copy link
Author

De-Lac commented Apr 4, 2016

it works... sorry, I was injecting '$ionicNativeTransitionsProvider' also in app.run(). I removed the dependency from .run() and now it works.

@shailendramonu
Copy link

shailendramonu commented Sep 26, 2016

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 ionic-team/ionic-bower#1.0.0

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants