mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-13 12:22:02 +08:00
changed [illegal] variant type usage to a prefered static typing
This commit is contained in:
1 parent
7469c06f42
commit
18beeab5e2
1 file changed
+3
-3
@@ -56,13 +56,13 @@ function test_computed() {
|
||||
function MyViewModel1() {
|
||||
this.price = ko.observable(25.99);
|
||||
|
||||
this.formattedPrice = ko.computed({
|
||||
this.formattedPrice = ko.computed<string>({
|
||||
read: function () {
|
||||
return '$' + this.price().toFixed(2);
|
||||
},
|
||||
write: function (value) {
|
||||
value = parseFloat(value.replace(/[^\.\d]/g, ""));
|
||||
this.price(isNaN(value) ? 0 : value);
|
||||
var num = parseFloat(value.replace(/[^\.\d]/g, ""));
|
||||
this.price(isNaN(num) ? 0 : num);
|
||||
},
|
||||
owner: this
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user