Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing same function between 3 controllers
Message
 
 
À
18/02/2015 10:40:38
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01615503
Message ID:
01615524
Vues:
34
>Looks as if you're using angular-ui. If that's the case wouldn't a nested state/view be a good solution.

No, the grids are not identical.

>P.S. Don't like the $parent.$parent part. If's inheritantly (no pun intended) fragile since it depends on a known/fixed scope hierarchy....

I don't like it either, but it was not my code, so I left it as is. I did figure out a solution. I declared the function at the top of the file and had to pass $scope, $rootScope and $state to it and then I was just calling this function 3 times (which I don't like either, but can live with it).
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform