Currently, I am working with Angular and TypeScript to interact with a REST webservice. Since I am still new to TypeScript, my issue might be basic or my approach could be incorrect. The problem I am facing is receiving an error TS1005: ';' expected
when compiling my exampleController.ts using Grunt.
I have already researched for a solution but unfortunately, I have not come across anything that has been helpful. In my code, I am already utilizing
import angular = require('angular');
Here is a snippet of my controller code:
class ExampleComponentController {
public static $inject = [
'$scope',
'productRestService',
'$http'
];
$scope.submit = function(form) {
var config = {
'username' : $scope.name,
'password' : $scope.pass
};
var $promise = $http.post('requat_url', config)
.success(function(data, status, headers, config) {
...
})
.error(function(data, status, headers, config) {
...
});
};
constructor(...) {...}
}
The error occurs on the line where $scope.submit
is defined. Any advice would be greatly appreciated.