How to pass an Angular Js and Ionic dependency

Asked

Viewed 149 times

1

I’m trying to pass a dependency on my module to use a Unique filter, I need to filter names in mine Views. What happens is this: when I do it this way, in my controller, without creating routes in my system, sure.

angular.module("myApp,['ui.filters']")
       .controller("papaRoca",function($scope,Data, $location). 

You can see that I put the dependency ['ui.filters']. No routes on my system works, but when I put the routes for browsing the pages, if I put this dependency on my controller ['ui.filters'], of error.

Why does this happen? When you create routes in the system dependencies are created elsewhere?

  • You must inject this dependency into your global module. You have one, right?

  • My global module is how I was going to pass this ui.Filters ? I’ve tried it in several ways and nothing . angular.module('myapp',['Ionic']). config(['$controllerProvider', Function($controllerProvider) { $controllerProvider.allowGlobals(); }]). config(Function ($ionicConfigProvider) { $ionicConfigProvider.backButton.previousTitleText(false). text(""). icon("ion-Arrow-left-c"); });

2 answers

0

Note that you are injecting the library into the name of your module, missed separating the two parts with a comma.

 angular.module('myApp', ['ui.filters'])
      .controller("papaRoca", function($scope, Data, $location) {

  });

0

Diogoaugusto even with that worked someone told me that this library of conflict with and injection of $stateProvider . I see no outputs now someone knows some way to filter data not to repeat name with inoic and Angular js?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.