Misko,
A lot to take in, here is a smattering of questions/comments
1. In the example you are not using token replace for ‘name’, I think it would be good to have in example.
1b. It appears that ‘:foo’ is gone in favor of ‘{{foo}}’
2. I like the- response: ‘response.data.results’ but am wondering if maybe named something different. If I’m correct in my understanding, it’s a way of targeting the response object. So, If you return
{"results":[{"author":"misk","title":"AngularJS"},
{"author":"ferdo3","title":"ferdo's adventures"}],"counter": "2" }
then you would have as a response[{"author":"misk","title":"AngularJS},{"author":"ferdo3","title":"ferdo's adventures”}]
How about something like responseTarget?
3. It’s going to take a bit to fully digest the internalize/externalize stuff. It seems that you are giving the ability to have a formalized approach to applying “transforms” (or not) to the returned data. Since you are able to declare these functions, it makes it very testable and of course that’s always a good thing.
4. The doc on Task has confusing elements, I’m going to have to read and reread. I’ll post questions later.
That’s all I have for now, I’m sure I’ll have more
--dan
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2113/4886 - Release Date: 03/22/12
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/LfzyegAo3Y8J.
The new code works, and the controller is better: clean and simple.The service code does as little as necessary.All of which is excellent.But it is considerably harder to grok, because there are a lot of layers of abstraction.
I think this change usefully illustrates the strength and weakness of AngularJS.The strength is its power and conceptual rigor (and its testing story, which derives from these qualities).The weakness is a practical rather than intellectual matter: the heavy use of DI and functional OO will be hard for many to grasp.
Web developers with a Java EE background won't feel out of place. A factory is a factory is a factory.But the PHP crowd will be lost. [Insert joke]OK, they are extremes.But I think even many RoR developers will find AngularJS's conceptual universe a challenge.
There is anecdotal evidence of this: the word on the street is that AngularJS has a steeper learning curve than competitors.Of course, your response is that the extra investment to understand it will pay big long-term dividends.I agree, but I'm afraid that many won't make the effort.People make firm judgements after minimal investigation. I'm sure you've seen this with AngularJS.
My 2c: For widespread adoption, AngularJS should aim to require minimal code for the easy cases.
Talking to a fully compliant RESTful JSON service is one of these.The developer should not need to supply much more than a URL with parameter placeholders.I.e., the developer should not need to be fully aware of all the behind the scenes machinery.
(Maybe this is already the case with the new $resource. Hard for me to tell, since of course that wasn't your aim with the demo)
A practical issue might be that much of your direct feedback comes from internal Google users.They are (in my experience) both very smart & well-educated, and not typical web devs.There are also plenty of talented people on this newsgroup.Their feedback is invaluable for the more challenging use cases.But I would recommend as much attention be paid to the inexperienced developers, on this group, and with case studies and documentation.
Misko,
A lot to take in, here is a smattering of questions/comments
1. In the example you are not using token replace for ‘name’, I think it would be good to have in example.
1b. It appears that ‘:foo’ is gone in favor of ‘{{foo}}’
2. I like the- response: ‘response.data.results’ but am wondering if maybe named something different. If I’m correct in my understanding, it’s a way of targeting the response object. So, If you return
{"results":[{"author":"misk","title":"AngularJS"},{"author":"ferdo3","title":"ferdo's adventures"}],"counter": "2" }then you would have as a response[{"author":"misk","title":"AngularJS},{"author":"ferdo3","title":"ferdo's adventures”}]
How about something like responseTarget?
Hi Misko,
So when I look at this snippet, the ‘url’ and ‘headers’ params make total sense. What doesn’t make 100% sense immediately is ‘response’. I know I’m going to get a response back but there is a param called ‘response’ with ‘response’ inside the literal. I pretty much got it at first glance, but it may be confusing for others. I was thinking that a different param name may be more clear. Instead of responseTarget use responseExpression or responseExpr? I don’t think it’s a real big deal if it’s well documented
Also, your doc says it’s a method not an expression.
One other question, could you have url: 'https://api.parse.com/1/classes/{{name}}/' instead?
return $resource(
{
url: 'https://api.parse.com/1/classes/' + name + '/',
headers: {
'X-Parse-Application-Id': parseAppId,
'X-Parse-REST-API-Key': parseApiKey,
'X-Requested-With': undefined
},
response: 'response.data.results'
}
thanks
Version: 10.0.1424 / Virus Database: 2113/4889 - Release Date: 03/23/12
On Fri, Mar 23, 2012 at 6:24 PM, Misko Hevery <mi...@hevery.com> wrote:
> On Fri, Mar 23, 2012 at 6:50 AM, Peter Bacon Darwin <pe...@bacondarwin.com>
> wrote:
>>>
>>> Web developers with a Java EE background won't feel out of place. A
>>> factory is a factory is a factory.
>>> But the PHP crowd will be lost. [Insert joke]
>>> OK, they are extremes.
>>> But I think even many RoR developers will find AngularJS's conceptual
>>> universe a challenge.
>
>
> So we are thinking of providing modules for common technologies such as RoR
> so that they can hook up the resources to their RoR backend supper easy.
> Which remains me, do you know of any RoR folks who could help us work on it?
>
I would gladly do it. Just let me know what do you have in mind.
Best regards,
Adam Pohorecki
Hi Misko,
So when I look at this snippet, the ‘url’ and ‘headers’ params make total sense. What doesn’t make 100% sense immediately is ‘response’. I know I’m going to get a response back but there is a param called ‘response’ with ‘response’ inside the literal. I pretty much got it at first glance, but it may be confusing for others. I was thinking that a different param name may be more clear. Instead of responseTarget use responseExpression or responseExpr? I don’t think it’s a real big deal if it’s well documented
Also, your doc says it’s a method not an expression.
One other question, could you have url: 'https://api.parse.com/1/classes/{{name}}/' instead?
I would gladly do it. Just let me know what do you have in mind.
I was actually thinking about something “dataXXX” instead of response, I kinda like dataLocation. I don’t know, I’d be interested for someone else to chime in. Maybe I’m overthinking things.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
you can do this very simply, just copy the $resource code from current
angular (https://github.com/angular/angular.js/blob/master/src/service/resource.js)
and override the new implementation... (or add it with $resourceBC
name or whatever you like).
V.
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/Cq3G3gtobx8J.
V.
>> > angular+u...@googlegroups.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
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/96-pf7UKPi0J.
>
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> Misko,
>
> What would be great is if you could make the original $resource functionality in a module that could coincide with 1.0?? Maybe have an ng-contrib namespace?
>
> That would help a lot
Yes - that would help *tremendously*. I was just thinking of trying to do that since this isn't going to be in 1.0.0 and one of our apps that is being converted relies on it quite a bit.
Thanks.
> --dan
>
>
> On Mar 26, 2012, at 10:34 AM, Misko Hevery wrote:
>
>> Hi All,
>>
>> I spent a lot of time thinking about this over the weekend, and realized that the new design while better, does not address many of the real world issues, namely, the ability to have nested resources, and uniform ways of dealing with the ids.
>>
>> So after thinking about it some more, we decided to take the resources out of angular core and put them in a separate module. That way we can release angular v1.0.0 and have the resources have its own life, as i don't think we are going to get something we like in the next week or two, and there is no reason to stall the core of angular. It also means that you will be able to chose different resource implementations for yourself.
>>
>> -- misko
--
Robert B. Weeks
-- misko
>> > 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
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/96-pf7UKPi0J.
>
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.