Hello,
New user here. I’m trying to implement an angular app. Cool stuff so are but I’m having an issue: I have the SDK installed and I copied the code from here: https://github.com/dreamfactorysoftware/angular-dreamfactory into my app.
I have successfully set it up to make calls to the RESTful endpoint that I’ve got set up coming from a remote mySQL db… I get a 200 response and I get data like this in my HTTP response. (I’ve shortened it for brevity)
{“record”:[{“firstName”:“Thelma”,“lastName”:“Brooks”},{“firstName”: “Randy” : “lastName” : “Marsh”]}
However, the success response in my angular service promise never gets fired and subsequent result does not get sent back to my controller.
In fact it looks like the promise gets skipped entirely. I put alerts in both success and failure handlers in my service and they never get hit.
Also did you guys test your code in examples at https://github.com/dreamfactorysoftware/angular-dreamfactory … there are multiple syntactical errors in each of the examples you posted . Very frustrating to work with as a new user coming into it
For example you’re missing a closing ‘)’ at the end of this snippet:
.controller('MyCtrl', ['DreamFactory', function(DreamFactory) {
// model for login credentials
$scope.creds = {
email: '',
password: ''
}
// Login function
$scope.loginFunc = function() {
// Call to the DreamFactory user service using provided login method
DreamFactory.api.user.login($scope.creds,
// Success function
function(data) {
// Handle login success
},
// Error function
function(error) {
// Handle Login failure
}
}
}];
And you misplaced the final return statement of the deferred promise in the last example on that page.
I just want an example of a controller, service and associated html snippet that will successfully get me a response in the simplest manner possible. Is there a jsfiddle that you guys have that can do this?