Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
question about MIT licensed angular $resource
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dobrica Pavlinusic  
View profile  
 More options Oct 31 2010, 1:35 pm
From: Dobrica Pavlinusic <dpav...@gmail.com>
Date: Sun, 31 Oct 2010 10:35:30 -0700 (PDT)
Local: Sun, Oct 31 2010 1:35 pm
Subject: question about MIT licensed angular $resource
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:

http://github.com/dpavlin/angular-mojolicious

(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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Misko Hevery  
View profile  
 More options Oct 31 2010, 3:23 pm
From: Misko Hevery <mi...@hevery.com>
Date: Sun, 31 Oct 2010 12:23:21 -0700
Local: Sun, Oct 31 2010 3:23 pm
Subject: Re: question about MIT licensed angular $resource

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 read
http://angularjs.org/Service:$resource

-- Misko

On Sun, Oct 31, 2010 at 10:35 AM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:

  example.zip
2K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dobrica Pavlinusic  
View profile  
 More options Oct 31 2010, 5:31 pm
From: Dobrica Pavlinusic <dpav...@gmail.com>
Date: Sun, 31 Oct 2010 14:31:09 -0700 (PDT)
Local: Sun, Oct 31 2010 5:31 pm
Subject: Re: question about MIT licensed angular $resource
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.

I have similar problem with http://angularjs.org/Cookbook:DeepLinking

It seems that something like:

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Misko Hevery  
View profile  
 More options Oct 31 2010, 6:19 pm
From: Misko Hevery <mi...@hevery.com>
Date: Sun, 31 Oct 2010 15:19:59 -0700
Local: Sun, Oct 31 2010 6:19 pm
Subject: Re: question about MIT licensed angular $resource

That is because we changed the rules about when things are run

angular.service('myApplication', function($route){
 $route.when("", {template:'/cb/welcome.html',
controller:WelcomeCntl}); // never called
 ...

}, {$inject:['$route'*], $creation:'eager'*});

and it should do the trick.

-- Misko

On Sun, Oct 31, 2010 at 2:31 PM, Dobrica Pavlinusic <dpav...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Derek Prothro  
View profile  
 More options Oct 31 2010, 6:11 pm
From: Derek Prothro <dprot...@google.com>
Date: Sun, 31 Oct 2010 15:11:18 -0700
Local: Sun, Oct 31 2010 6:11 pm
Subject: Re: question about MIT licensed angular $resource

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Eagle  
View profile  
 More options Nov 20 2010, 7:47 pm
From: Alex Eagle <aeagle22...@gmail.com>
Date: Sat, 20 Nov 2010 16:47:16 -0800 (PST)
Local: Sat, Nov 20 2010 7:47 pm
Subject: Re: question about MIT licensed angular $resource
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Misko Hevery  
View profile  
 More options Nov 20 2010, 8:18 pm
From: Misko Hevery <mi...@hevery.com>
Date: Sun, 21 Nov 2010 01:18:40 +0000
Local: Sat, Nov 20 2010 8:18 pm
Subject: Re: question about MIT licensed angular $resource

sorry alex, we are currently in the process of rewriting the documentation.
You can see the new one here: http://code.angularjs.org/docs-0.9.4/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »