Controller: var myGoalsCtrl = myproject.controller('MyGoalsCtrl',function ($scope, $log, MyGoalsService, completedGoals, incompleteGoals){
// need to retrieve two sets of data. var completedStatus = "completed"; var incompleteStatus = "incomplete";
// and get the goals which I have done $scope.goalTemplates = goalTemplates; $scope.completedGoals = completedGoals; $scope.incompleteGoals = incompleteGoals; }
When I step through the code and hover over completedGoals and incompleteGoals, they are populated with goals and are resolved, however at the end of teh controller it throws the error unknownProvider completedGoalsProvider.
Please help!
OpenNota
unread,
Oct 8, 2013, 6:20:35 PM10/8/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Oh, really? Can you post a working example, demonstrating your problem?
agileDev
unread,
Oct 9, 2013, 10:11:51 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Thanks! Nice catch angular 1.2.0.
I have to get a plunkr up but this is the jist of it, the properties resolve but at the end of the controller's initialization it throws the unknown provider exception.
agileDev
unread,
Oct 9, 2013, 10:28:09 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Where he stored the data in a variable in the service, so "load" isn't really injected into the controller but it is bound by the service - is this a best practice?
Thanks guys! Really new to all this.
On Wednesday, October 9, 2013 10:11:51 AM UTC-4, agileDev wrote:
OpenNota
unread,
Oct 9, 2013, 10:43:54 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Aha, got it. You only need to specify controller once, in app.js. The second one, in the html code, is instantiated by the ngController directive, which does not know about `resolve', so it throws an exception.
agileDev
unread,
Oct 9, 2013, 10:49:22 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Hmm...I'm not sure I understand, am I doing something wrong in app.js then? or is it that I shouldn't be injecting properties defined in the resolve in the controller?
OpenNota
unread,
Oct 9, 2013, 11:07:46 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Just remove ng-controller="..." from your html. This second controller NOT injected with goals.
agileDev
unread,
Oct 9, 2013, 11:16:15 AM10/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
Eurika!! Yes that was it, you're a genius @OpenNota. Thank you so much :)
Perry Gollo
unread,
Feb 15, 2015, 12:01:58 PM2/15/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
I love you guys!!
have been banging my head for hours...
songtory
unread,
Nov 12, 2015, 1:15:18 AM11/12/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message