hantsy / angularjs-grails-sample Goto Github PK
View Code? Open in Web Editor NEWA RESTful sample using AngularJS/Bootstrap as frontend and Grails as REST API producer
A RESTful sample using AngularJS/Bootstrap as frontend and Grails as REST API producer
There appears to be a missing config option because OPTIONS requests are denied:
OPTIONS http://localhost:8080/angularjs-grails-sample/api/books.json 403 (Forbidden) angular.js:9312
XMLHttpRequest cannot load http://localhost:8080/angularjs-grails-sample/api/books.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
as.controller('EditBookCtrl', ['$scope', '$rootScope', '$http', '$location', 'apiUrl', function($scope, $rootScope, $http, $routeParams, $location, apiUrl)
should be
as.controller('EditBookCtrl', ['$scope', '$rootScope', '$http', '$routeParams', '$location', 'apiUrl', function($scope, $rootScope, $http, $routeParams, $location, apiUrl)
Could you please check why after successfull login your sample make two calls to the rest server ?
in this trace you can notice these calls to the network
GET http://localhost:8080/angularjs-grails-sample/api/status
GET http://localhost:8080/angularjs-grails-sample/api/books.json
GET http://localhost:8080/angularjs-grails-sample/api/books.json
regards
GET http://localhost:8080/angularjs-grails-sample/api/status
200 OK 215ms
angular.js (line 9312)
HeadersResponseJSON
{"user":{"class":"com.hantsylabs.grails.example.security.Person","id":1,"accountExpired":false,"accountLocked":false,"enabled":true,"password":"$2a$10$J1jQcEQ21jgwOAqVFfzhy.jpLZZLPyGnz3oYL7UDb6Pnj6OCgdUFy","passwordExpired":false,"username":"test"}}
dont intercept...
app.js (line 68)
app.js (line 145)
GET http://localhost:8080/angularjs-grails-sample/api/books.json
200 OK 250ms
angular.js (line 9312)
HeadersResponseJSON
[{"class":"com.hantsylabs.grails.example.domain.Book","id":1,"author":"Gavin King","price":99.0,"title":"Java Persistence with Hibernate"},{"class":"com.hantsylabs.grails.example.domain.Book","id":2,"author":"Matt Raible","price":29.0,"title":"Spring Live"}]
GET http://localhost:8080/angularjs-grails-sample/api/books.json
200 OK
253ms
angular.js (line 9312)
HeadersResponseJSON
[{"class":"com.hantsylabs.grails.example.domain.Book","id":1,"author":"Gavin King","price":99.0,"title":"Java Persistence with Hibernate"},{"class":"com.hantsylabs.grails.example.domain.Book","id":2,"author":"Matt Raible","price":29.0,"title":"Spring Live"}]
Please add the repositories " mavenRepo "http://repo.spring.io/milestone/" " to build config file. App is not coming up because of this ....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.