linemanjs / lineman-angular-template

A Lineman Application Template using AngularJS
251 stars 88 forks source link

default BookService not working #52

Closed sangel10 closed 10 years ago

sangel10 commented 10 years ago

By default the list-of-books template is setup to work with a resource but has commented out code that uses a service. If you uncomment all the related code in books.html and books_controller.js the GET request does not work. When I inspect the models using Batarang I see

Books:  { 
then: null
catch: null
finally: null
success: null
error: null
 } 

my application.js has the following settings


        server: {
            pushState: true,
            // API Proxying
            //
            // During development, you'll likely want to make XHR (AJAX) requests to an API on the same
            // port as your lineman development server. By enabling the API proxy and setting the port, all
            // requests for paths that don't match a static asset in ./generated will be forwarded to
            // whatever service might be running on the specified port.
            //
            apiProxy: {
                enabled: true,
                host: 'localhost',
                port: 3000,
                prefix: 'api'
                // prefix: ''
            },
        },

When I try similar $http.get() requests to a local API I am using I get the same result. Am I doing something wrong or is this a bug?

davemo commented 10 years ago

I fixed this up for you @sangel10, there are now two separate routes and template files for both $resource and $http examples. Hope this helps :)