I am facing an issue with some red squiggles in my code:
https://i.sstatic.net/UBmgi.jpg
To address this, I have declared variables like this:
import SearchFilterViewModel = SearchFilter.SearchFilterViewModel;
import SearchResultsViewModel = SearchResults.SearchResultsViewModel;
import AddProductViewModel = AddProduct.AddProductViewModel;
import Validator = Validation.Validator;
module Bindings {
export class Binder {
constructor() {
searchFilterViewModel = new SearchFilterViewModel();
searchFilterViewModel.errors = ko.validation.group(searchFilterViewModel);
searchResultsViewModel = new SearchResultsViewModel();
addProductViewModel = new AddProductViewModel();
ko.applyBindings(searchFilterViewModel, $("#search-filter-page")[0]);
ko.applyBindings(searchResultsViewModel, $("#search-results-page")[0]);
ko.applyBindings(addProductViewModel, $("#add-product-page")[0]);
}
}
}
After that, I execute the following code:
$(document).ready(function () {
//apply bindings
var binder = new Binder();
}
The code compiles and works as expected. Any suggestions on how to eliminate those red underlines?