Pass A Input Field Value Into Angularjs $resource Undefined And Error Shows Unknown Scope Provider
=========================================================================== Update 1 Fixed code produce new error of ReferenceError: inputName is not defined on the line of inp
Solution 1:
http://plnkr.co/edit/CKgWrson3IbMugRKdX5p?p=preview
A few problems that I fixed that others pointed out in the comment.
Remove $scope from factory. Here you are getting a generic $scope object but not the actual scope. You will get that in the controller. When you call angular resource with query() the first argument is already the param. But you can specify the common params like you did before.
function($resource) {
return$resource('mocked-resource.json', {
callback: 'JSON_CALLBACK'
}, {
query: {
method: 'GET',
isArray: true
}
});
Hope this helps.
Solution 2:
inputName:inputName,
second inputName refer to not existing variable. I think this line can be removed at all. But it depends on what you want to achieve.
Post a Comment for "Pass A Input Field Value Into Angularjs $resource Undefined And Error Shows Unknown Scope Provider"