angularjs - $urlRouterProvider not working with ngClipProvider -


i'm using ngclip plugin attempt add "copy clipboard" option web app. using ui-router in module config. problem when add ngclipprovider dependency .config, $urlrouterprovider becomes undefined. when remove it, $urlrouterprovider object again. below code:

var app = angular.module('app',['ui.router', 'ui.date', 'nganimate', 'angular-loading-bar', 'orders-directives', 'orders-controllers', 'orders-services', 'orders-factories', 'ngclipboard']); //config app.config(['ngclipprovider', function($stateprovider, $urlrouterprovider, ngclipprovider){     $urlrouterprovider.otherwise('/');     $stateprovider.state('/', {         url: '/',         templateurl: 'templates/admin-view.html',         controller: 'orderscontroller ordersctrl'     }).state('order', {         url: '/order/:ordernum?id',         templateurl: 'templates/order-details.html',         controller: 'orderdetailscontroller orderctrl'     }).state('export', {         url: '/export',         templateurl: 'templates/review-export.html',         controller: 'reviewexportcontroller reviewexportctrl'     });     //ngclipprovider.setpath("../plugins/zeroclipboard/zeroclipboard.swf"); }]); 

if remove "['ngclipprovider .....]" section , "ngclipprovider" function parameters, works. above, $urlrouterprovider null.

you messing inline dependency injection array , missed add '$stateprovider', '$urlrouterprovider' before 'ngclipprovider'

app.config(['$stateprovider', '$urlrouterprovider', 'ngclipprovider',       function($stateprovider, $urlrouterprovider, ngclipprovider){      //code here... }]) 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -