Stellen Sie window.location mit TypeScript ein
Ich erhalte eine Fehlermeldung mit dem folgenden TypeScript-Code:
///<reference path='../../../Shared/typescript/jquery.d.ts' />
///<reference path='../../../Shared/typescript/jqueryStatic.d.ts' />
function accessControls(action: Action) {
$('#logoutLink')
.click(function () {
var $link = $(this);
window.location = $link.attr('data-href');
});
}
Ich erhalte einen unterstrichenen roten Fehler für Folgendes:
$link.attr('data-href');
Die Nachricht lautet:
Cannot convert 'string' to 'Location': Type 'String' is missing property 'reload' from type 'Location'
Weiß jemand was das bedeutet?