angular.module("myapp", [])
.controller("UsersController", function (testFactory, $scope) {
$scope.post = function () {
testFactory.getApiValue("123");
}
$scope.change = function () {
testFactory.getApiValue($scope);
}
.factory("testFactory", function($http) {
return
{
getApiValue: function(token)
{
return $http.post('api/Printers/1');
}
}
})
I'm encountering an Expected Identifier
error in Visual Studio when running this code.
If you spot any issues in the code, could you please advise on how to fix them?
Your feedback on resolving this error is highly appreciated. Thank you!