Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Knockout.js mvc4中具有有限字符的剔除数据文本绑定_Knockout.js - Fatal编程技术网

Knockout.js mvc4中具有有限字符的剔除数据文本绑定

Knockout.js mvc4中具有有限字符的剔除数据文本绑定,knockout.js,Knockout.js,我必须做剔除数据文本绑定。我想在视野中展现有限的个性。我试过了,但没用。这里我附上了我的代码。任何人都可以检查我的代码和帮助吗 这是我的代码 <span data-bind="text: (Description.length > 10 ? Description().substring(0, 10) + '...' : Description)"></span> 我看不到重复的答案,但这会起作用,您缺少检查长度的描述中的括号说明().长度 <span da

我必须做剔除数据文本绑定。我想在视野中展现有限的个性。我试过了,但没用。这里我附上了我的代码。任何人都可以检查我的代码和帮助吗

这是我的代码

<span data-bind="text: (Description.length > 10 ? Description().substring(0, 10) + '...' : Description)"></span>

我看不到重复的答案,但这会起作用,您缺少检查长度的描述中的括号<代码>说明().长度

<span data-bind="text: (Description().length > 10 ? Description().substring(0, 10) + '...' : Description)"></span>


请参阅重复的:。该问题不存在。。。404未找到重复问题已被删除。这是一个已删除的问题(现在),10K用户可以看到它。它是一个完全相同的副本……在任何情况下,如果您在第二个
?:
参数中将
Description
作为函数调用,您可能应该这样做。