First, let me say that I'm amazed how logical angular is. I watched
video first, and then went started reading wiki and went through
tutorial at getangular.com. I was hooked. I had several use cases for
our internal needs, so I started writing REST server for our data that
is available at:
(it's perl code based on mojolicious framework and provides in-memory
REST API, but that's not important).
Then I tried examples which worked on getangular.com against
angularjs.org checkout on github, and I was at first surprised that
things like ng-entity didn't exists in checkout. Hack, not a problem,
it seemed, there is $resource which will help.
But, after few days, this is the point in which I'm stuck. I can't
find $resouce example which works and uses code with backward
incompatible changes (changing {inject:['$resource']} to {$inject:
['$resource']}) didn't help).
I have working $xhr stub, so I could generate controllers around that,
but $resource seems like a solution for just that problem, so I'm
first asking here.
Everything I saw so far is sufficiently advanced to call it magic :-)
We are happy to help out. Do you think you could send us a code sample so that we have something more concrete talk about, and what exactly you have trouble with?
I have attached an simple example of how to fetch data using $resource. Because it has XHR, you need to run it through a web server so that url read http://. file:// urls, will cause issues in some browser (like chrome) since they consider it a violation of XHR. (but file:// should work on safari)
Look at tho attached code, and let me know which part does not make sense, and you need more help with. Also I assume that you have read http://angularjs.org/Service:$resource
-- Misko
On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:
> First, let me say that I'm amazed how logical angular is. I watched > video first, and then went started reading wiki and went through > tutorial at getangular.com. I was hooked. I had several use cases for > our internal needs, so I started writing REST server for our data that > is available at:
> (it's perl code based on mojolicious framework and provides in-memory > REST API, but that's not important).
> Then I tried examples which worked on getangular.com against > angularjs.org checkout on github, and I was at first surprised that > things like ng-entity didn't exists in checkout. Hack, not a problem, > it seemed, there is $resource which will help.
> But, after few days, this is the point in which I'm stuck. I can't > find $resouce example which works and uses code with backward > incompatible changes (changing {inject:['$resource']} to {$inject: > ['$resource']}) didn't help).
> I have working $xhr stub, so I could generate controllers around that, > but $resource seems like a solution for just that problem, so I'm > first asking here.
> Everything I saw so far is sufficiently advanced to call it magic :-)
> -- > You received this message because you are subscribed to the Google Groups > "Angular" group. > To post to this group, send email to angular@googlegroups.com. > To unsubscribe from this group, send email to > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > . > For more options, visit this group at > http://groups.google.com/group/angular?hl=en.
Thanks for $resource example. I tried to get buzz example working, and
it seems
that I don't have a problem with $resource, but with angular.service()
and new
$inject.
> We are happy to help out. Do you think you could send us a code sample so
> that we have something more concrete talk about, and what exactly you have
> trouble with?
> I have attached an simple example of how to fetch data using $resource.
> Because it has XHR, you need to run it through a web server so that url
> read http://. file:// urls, will cause issues in some browser (like chrome)
> since they consider it a violation of XHR. (but file:// should work on
> safari)
> Look at tho attached code, and let me know which part does not make sense,
> and you need more help with. Also I assume that you have readhttp://angularjs.org/Service:$resource
> -- Misko
> On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:
> > First, let me say that I'm amazed how logical angular is. I watched
> > video first, and then went started reading wiki and went through
> > tutorial at getangular.com. I was hooked. I had several use cases for
> > our internal needs, so I started writing REST server for our data that
> > is available at:
> > (it's perl code based on mojolicious framework and provides in-memory
> > REST API, but that's not important).
> > Then I tried examples which worked on getangular.com against
> > angularjs.org checkout on github, and I was at first surprised that
> > things like ng-entity didn't exists in checkout. Hack, not a problem,
> > it seemed, there is $resource which will help.
> > But, after few days, this is the point in which I'm stuck. I can't
> > find $resouce example which works and uses code with backward
> > incompatible changes (changing {inject:['$resource']} to {$inject:
> > ['$resource']}) didn't help).
> > I have working $xhr stub, so I could generate controllers around that,
> > but $resource seems like a solution for just that problem, so I'm
> > first asking here.
> > Everything I saw so far is sufficiently advanced to call it magic :-)
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Angular" group.
> > To post to this group, send email to angular@googlegroups.com.
> > To unsubscribe from this group, send email to
> > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/angular?hl=en.
> Thanks for $resource example. I tried to get buzz example working, and > it seems > that I don't have a problem with $resource, but with angular.service() > and new > $inject.
> angular.service('myApplication', function($route){ > $route.when("", {template:'/cb/welcome.html', > controller:WelcomeCntl}); // never called > ... > }, {$inject:['$route']});
> isn't sufficient. I don't see $route.when initialization when I dump > {{$route}} i just get:
> {"current":null,"routes":{}}
> On Oct 31, 8:23 pm, Misko Hevery <mi...@hevery.com> wrote: > > Hi Dobrica,
> > We are happy to help out. Do you think you could send us a code sample so > > that we have something more concrete talk about, and what exactly you > have > > trouble with?
> > I have attached an simple example of how to fetch data using $resource. > > Because it has XHR, you need to run it through a web server so that url > > read http://. file:// urls, will cause issues in some browser (like > chrome) > > since they consider it a violation of XHR. (but file:// should work on > > safari)
> > Look at tho attached code, and let me know which part does not make > sense, > > and you need more help with. Also I assume that you have readhttp:// > angularjs.org/Service:$resource
> > -- Misko
> > On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com > >wrote:
> > > First, let me say that I'm amazed how logical angular is. I watched > > > video first, and then went started reading wiki and went through > > > tutorial at getangular.com. I was hooked. I had several use cases for > > > our internal needs, so I started writing REST server for our data that > > > is available at:
> > > (it's perl code based on mojolicious framework and provides in-memory > > > REST API, but that's not important).
> > > Then I tried examples which worked on getangular.com against > > > angularjs.org checkout on github, and I was at first surprised that > > > things like ng-entity didn't exists in checkout. Hack, not a problem, > > > it seemed, there is $resource which will help.
> > > But, after few days, this is the point in which I'm stuck. I can't > > > find $resouce example which works and uses code with backward > > > incompatible changes (changing {inject:['$resource']} to {$inject: > > > ['$resource']}) didn't help).
> > > I have working $xhr stub, so I could generate controllers around that, > > > but $resource seems like a solution for just that problem, so I'm > > > first asking here.
> > > Everything I saw so far is sufficiently advanced to call it magic :-)
> > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Angular" group. > > > To post to this group, send email to angular@googlegroups.com. > > > To unsubscribe from this group, send email to > > > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com>> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/angular?hl=en.
> > example.zip > > 2KViewDownload
> -- > You received this message because you are subscribed to the Google Groups > "Angular" group. > To post to this group, send email to angular@googlegroups.com. > To unsubscribe from this group, send email to > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > . > For more options, visit this group at > http://groups.google.com/group/angular?hl=en.
Try changing the third parameter to angular.service to {$inject:['$route'], $creation: 'eager-published'}. I ran into this same problem a few days ago when updating to 0.9.0 and this fixed it for me. I think there's other values you can pass in for $creation, but I'm not sure what they are or what they do.
On Sun, Oct 31, 2010 at 2:31 PM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:
> Thanks for $resource example. I tried to get buzz example working, and > it seems > that I don't have a problem with $resource, but with angular.service() > and new > $inject.
> angular.service('myApplication', function($route){ > $route.when("", {template:'/cb/welcome.html', > controller:WelcomeCntl}); // never called > ... > }, {$inject:['$route']});
> isn't sufficient. I don't see $route.when initialization when I dump > {{$route}} i just get:
> {"current":null,"routes":{}}
> On Oct 31, 8:23 pm, Misko Hevery <mi...@hevery.com> wrote: > > Hi Dobrica,
> > We are happy to help out. Do you think you could send us a code sample so > > that we have something more concrete talk about, and what exactly you > have > > trouble with?
> > I have attached an simple example of how to fetch data using $resource. > > Because it has XHR, you need to run it through a web server so that url > > read http://. file:// urls, will cause issues in some browser (like > chrome) > > since they consider it a violation of XHR. (but file:// should work on > > safari)
> > Look at tho attached code, and let me know which part does not make > sense, > > and you need more help with. Also I assume that you have readhttp:// > angularjs.org/Service:$resource
> > -- Misko
> > On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com > >wrote:
> > > First, let me say that I'm amazed how logical angular is. I watched > > > video first, and then went started reading wiki and went through > > > tutorial at getangular.com. I was hooked. I had several use cases for > > > our internal needs, so I started writing REST server for our data that > > > is available at:
> > > (it's perl code based on mojolicious framework and provides in-memory > > > REST API, but that's not important).
> > > Then I tried examples which worked on getangular.com against > > > angularjs.org checkout on github, and I was at first surprised that > > > things like ng-entity didn't exists in checkout. Hack, not a problem, > > > it seemed, there is $resource which will help.
> > > But, after few days, this is the point in which I'm stuck. I can't > > > find $resouce example which works and uses code with backward > > > incompatible changes (changing {inject:['$resource']} to {$inject: > > > ['$resource']}) didn't help).
> > > I have working $xhr stub, so I could generate controllers around that, > > > but $resource seems like a solution for just that problem, so I'm > > > first asking here.
> > > Everything I saw so far is sufficiently advanced to call it magic :-)
> > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Angular" group. > > > To post to this group, send email to angular@googlegroups.com. > > > To unsubscribe from this group, send email to > > > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com>> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/angular?hl=en.
> > example.zip > > 2KViewDownload
> -- > You received this message because you are subscribed to the Google Groups > "Angular" group. > To post to this group, send email to angular@googlegroups.com. > To unsubscribe from this group, send email to > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > . > For more options, visit this group at > http://groups.google.com/group/angular?hl=en.
Can someone on the project please update the docs? None of them
(deeplink cookbook nor $route reference) mention the $creation
property. Also, the old docs on http://angularjs.org are missing the
'$' on $inject.
-Alex
On Oct 31, 2:11 pm, Derek Prothro <dprot...@google.com> wrote:
> Try changing the third parameter to angular.service to {$inject:['$route'],
> $creation: 'eager-published'}. I ran into this same problem a few days ago
> when updating to 0.9.0 and this fixed it for me. I think there's other
> values you can pass in for $creation, but I'm not sure what they are or what
> they do.
> On Sun, Oct 31, 2010 at 2:31 PM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:
> > Thanks for $resource example. I tried to get buzz example working, and
> > it seems
> > that I don't have a problem with $resource, but with angular.service()
> > and new
> > $inject.
> > isn't sufficient. I don't see $route.when initialization when I dump
> > {{$route}} i just get:
> > {"current":null,"routes":{}}
> > On Oct 31, 8:23 pm, Misko Hevery <mi...@hevery.com> wrote:
> > > Hi Dobrica,
> > > We are happy to help out. Do you think you could send us a code sample so
> > > that we have something more concrete talk about, and what exactly you
> > have
> > > trouble with?
> > > I have attached an simple example of how to fetch data using $resource.
> > > Because it has XHR, you need to run it through a web server so that url
> > > read http://. file:// urls, will cause issues in some browser (like
> > chrome)
> > > since they consider it a violation of XHR. (but file:// should work on
> > > safari)
> > > Look at tho attached code, and let me know which part does not make
> > sense,
> > > and you need more help with. Also I assume that you have readhttp://
> > angularjs.org/Service:$resource
> > > -- Misko
> > > On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com
> > >wrote:
> > > > First, let me say that I'm amazed how logical angular is. I watched
> > > > video first, and then went started reading wiki and went through
> > > > tutorial at getangular.com. I was hooked. I had several use cases for
> > > > our internal needs, so I started writing REST server for our data that
> > > > is available at:
> > > > (it's perl code based on mojolicious framework and provides in-memory
> > > > REST API, but that's not important).
> > > > Then I tried examples which worked on getangular.com against
> > > > angularjs.org checkout on github, and I was at first surprised that
> > > > things like ng-entity didn't exists in checkout. Hack, not a problem,
> > > > it seemed, there is $resource which will help.
> > > > But, after few days, this is the point in which I'm stuck. I can't
> > > > find $resouce example which works and uses code with backward
> > > > incompatible changes (changing {inject:['$resource']} to {$inject:
> > > > ['$resource']}) didn't help).
> > > > I have working $xhr stub, so I could generate controllers around that,
> > > > but $resource seems like a solution for just that problem, so I'm
> > > > first asking here.
> > > > Everything I saw so far is sufficiently advanced to call it magic :-)
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Angular" group.
> > > > To post to this group, send email to angular@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com >
> > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com>>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/angular?hl=en.
> > > example.zip
> > > 2KViewDownload
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Angular" group.
> > To post to this group, send email to angular@googlegroups.com.
> > To unsubscribe from this group, send email to
> > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com >
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/angular?hl=en.
On Sun, Nov 21, 2010 at 12:47 AM, Alex Eagle <aeagle22...@gmail.com> wrote: > Can someone on the project please update the docs? None of them > (deeplink cookbook nor $route reference) mention the $creation > property. Also, the old docs on http://angularjs.org are missing the > '$' on $inject.
> -Alex
> On Oct 31, 2:11 pm, Derek Prothro <dprot...@google.com> wrote: > > Try changing the third parameter to angular.service to > {$inject:['$route'], > > $creation: 'eager-published'}. I ran into this same problem a few days > ago > > when updating to 0.9.0 and this fixed it for me. I think there's other > > values you can pass in for $creation, but I'm not sure what they are or > what > > they do.
> > On Sun, Oct 31, 2010 at 2:31 PM, Dobrica Pavlinusic <dpav...@gmail.com > >wrote:
> > > Thanks for $resource example. I tried to get buzz example working, and > > > it seems > > > that I don't have a problem with $resource, but with angular.service() > > > and new > > > $inject.
> > > isn't sufficient. I don't see $route.when initialization when I dump > > > {{$route}} i just get:
> > > {"current":null,"routes":{}}
> > > On Oct 31, 8:23 pm, Misko Hevery <mi...@hevery.com> wrote: > > > > Hi Dobrica,
> > > > We are happy to help out. Do you think you could send us a code > sample so > > > > that we have something more concrete talk about, and what exactly you > > > have > > > > trouble with?
> > > > I have attached an simple example of how to fetch data using > $resource. > > > > Because it has XHR, you need to run it through a web server so that > url > > > > read http://. file:// urls, will cause issues in some browser (like > > > chrome) > > > > since they consider it a violation of XHR. (but file:// should work > on > > > > safari)
> > > > Look at tho attached code, and let me know which part does not make > > > sense, > > > > and you need more help with. Also I assume that you have readhttp:// > > > angularjs.org/Service:$resource
> > > > -- Misko
> > > > On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic < > dpav...@gmail.com > > > >wrote:
> > > > > First, let me say that I'm amazed how logical angular is. I watched > > > > > video first, and then went started reading wiki and went through > > > > > tutorial at getangular.com. I was hooked. I had several use cases > for > > > > > our internal needs, so I started writing REST server for our data > that > > > > > is available at:
> > > > > (it's perl code based on mojolicious framework and provides > in-memory > > > > > REST API, but that's not important).
> > > > > Then I tried examples which worked on getangular.com against > > > > > angularjs.org checkout on github, and I was at first surprised > that > > > > > things like ng-entity didn't exists in checkout. Hack, not a > problem, > > > > > it seemed, there is $resource which will help.
> > > > > But, after few days, this is the point in which I'm stuck. I can't > > > > > find $resouce example which works and uses code with backward > > > > > incompatible changes (changing {inject:['$resource']} to {$inject: > > > > > ['$resource']}) didn't help).
> > > > > I have working $xhr stub, so I could generate controllers around > that, > > > > > but $resource seems like a solution for just that problem, so I'm > > > > > first asking here.
> > > > > Everything I saw so far is sufficiently advanced to call it magic > :-)
> > > > > -- > > > > > You received this message because you are subscribed to the Google > > > Groups > > > > > "Angular" group. > > > > > To post to this group, send email to angular@googlegroups.com. > > > > > To unsubscribe from this group, send email to > > > > > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com>> > > > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com> > <angular%252Bunsubscribe@googlegroup s.com>> > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/angular?hl=en.
> > > > example.zip > > > > 2KViewDownload
> > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Angular" group. > > > To post to this group, send email to angular@googlegroups.com. > > > To unsubscribe from this group, send email to > > > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > <angular%2Bunsubscribe@googlegroups.com<angular%252Bunsubscribe@googlegroup s.com>> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/angular?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "Angular" group. > To post to this group, send email to angular@googlegroups.com. > To unsubscribe from this group, send email to > angular+unsubscribe@googlegroups.com<angular%2Bunsubscribe@googlegroups.com > > . > For more options, visit this group at > http://groups.google.com/group/angular?hl=en.