Integrating Taffy with AngularJS

240 views
Skip to first unread message

matthew attanasio

unread,
Mar 14, 2013, 12:03:52 AM3/14/13
to taffy...@googlegroups.com
Hello all

I have just begun to start a new project and decided that using the Taffy as coldfusion REST api  and AngularJS on the front end was the best solution.

I have managed to setup Taffy and AngularJS for the most part but I am having great difficulty with making calls from AngularJS using the $http service to Taffy and recieving a response.

I have posted a question on stackoverflow but havnt had to much help there.

I am able to open the Taffy Dashboard and use the mock client to perform a test on the resource components with the url '/products', I see that the response is 200 with correct JSON content being displayed in the content box.

/products uses the GET request 

When i try to access /products in the browser as such /api/index.cfm/products I am presented with a blank page, should I be seeing the JSON content in the browser (this might be part of my trouble ) ???

Any help on this matter will be greatly appreciated.

Regards Matthew

Adam Tuttle

unread,
Mar 14, 2013, 3:25:33 PM3/14/13
to taffy...@googlegroups.com
Just out of curiosity, try appending ".json" -- so it would be "/products.json". Let me know if that fixes it.

Adam

matthew attanasio wrote:
--
You received this message because you are subscribed to the Google
Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to taffy-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

matthew attanasio

unread,
Mar 14, 2013, 7:24:27 PM3/14/13
to taffy...@googlegroups.com
When I entered that in the browser that did work :) 
Do I always  have to append .json to recieve the proper response from the Taffy REST api. 

Since it works like this, maybe im not doing something else right in Angularjs

Thank you for your help.

AJ Mercer

unread,
Mar 14, 2013, 7:40:23 PM3/14/13
to taffy...@googlegroups.com
In angularJS are you setting content-type
Eg application/json 
--

AJ Mercer
<webonix:net strength="Industrial" /> | <webonix:org community="Open" />
http://twitter.com/webonix

matthew attanasio

unread,
Mar 14, 2013, 8:04:04 PM3/14/13
to taffy...@googlegroups.com
I thought that was just default, if not where would I do that?
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

AJ Mercer

unread,
Mar 14, 2013, 8:58:54 PM3/14/13
to taffy...@googlegroups.com

Check this out, should help
    http://docs.angularjs.org/#!/api/ng.$http

See headers section

Adam Tuttle

unread,
Mar 16, 2013, 12:30:06 PM3/16/13
to taffy...@googlegroups.com
Yes, the issue was that you weren't specifying the content type. You can either do it with ".json" at the end of the url (but before "?", if any), or use an Accept header.

This has been addressed in the latest code available in the 1.3-dev branch.

Adam

AJ Mercer wrote:

Check this out, should help
http://docs.angularjs.org/#!/api/ng.$http

See headers section

On Mar 15, 2013 8:04 AM, "matthew attanasio"
<matthew.at...@gmail.com

                <http://stackoverflow.com/questions/15386856/integrating-angualarjs-with-taffy-rest-api>

                I am able to open the Taffy Dashboard and use the
                mock client to
                perform a test on the resource components with the
                url '/products', I
                see that the response is 200 with correct JSON
                content being displayed
                in the content box.

                /products uses the GET request

                When i try to access /products in the browser as such
                /api/index.cfm/products I am presented with a blank
                page, should I be
                seeing the JSON content in the browser (this might be
                part of my
                trouble ) ???

                Any help on this matter will be greatly appreciated.

                Regards Matthew

                --
                You received this message because you are subscribed
                to the Google
                Groups "Taffy Users" group.
                To unsubscribe from this group and stop receiving
                emails from it, send
                an email to taffy-users...@__googlegroups.__com.
                For more options, visit
                https://groups.google.com/__grou__ps/opt_out
                <https://groups.google.com/groups/opt_out>.


            --
            You received this message because you are subscribed to
            the Google Groups "Taffy Users" group.
            To unsubscribe from this group and stop receiving emails
            from it, send an email to
            taffy-users+unsubscribe@__googlegroups.com.
            For more options, visit
            https://groups.google.com/__groups/opt_out
            <https://groups.google.com/groups/opt_out>.




        --

        *AJ Mercer*
        <webonix:net strength="Industrial" /> <http://webonix.net> |
        <webonix:org community="Open" /> <http://webonix.org>

        http://twitter.com/webonix
        Railo Community Manager


    --
    You received this message because you are subscribed to the Google
    Groups "Taffy Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to taffy-users...@googlegroups.com

Matthew Attanasio

unread,
Mar 17, 2013, 3:14:32 AM3/17/13
to taffy...@googlegroups.com
Ok thank you for your help I will use that branch from now on. ;)

Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "Taffy Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/taffy-users/cnWxDmCMnTo/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to taffy-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages