简体   繁体   English

在MVC中使用Knockout.js的含义

[英]Implication in using Knockout.js in MVC

在我的MVC项目中使用Knockout.js我看到很多很多优点,但在使用它之前我想确保使用相同的方法或使用Knockout.js时要采取的预防措施。

KnockoutJS is included by default starting with ASP.NET MVC4, so it's safe to say that you're going to see it a lot in ASP.NET MVC going forward. 默认情况下,KnockoutJS包含在ASP.NET MVC4中,因此可以肯定地说,您将在ASP.NET MVC中看到它很多。

Ultimately there aren't any conflicts of any sort that you have to worry about with Knockout with ASP.NET MVC. 最终,在使用ASP.NET MVC的Knockout时,您不必担心任何类型的冲突。 It doesn't conflict with any of the DataAnnotations or other auto-scaffolded JavaScript. 它不与任何DataAnnotations或其他自动搭建的JavaScript冲突。

You don't get any knockout scaffolding for free (not like DataAnnotations and jQuery validation) so you only use it in instances where you explicitly code it into a view or partial yourself. 你没有免费得到任何淘汰脚手架(不像DataAnnotations和jQuery验证)所以你只能在你明确地将它编码到一个视图或部分自己编写的实例中使用它。

I use Knockout heavily in MVC4 and in Node.JS applications and it works great in tandem with jQuery - never ran into any issues with it on either platform. 我在MVC4和Node.JS应用程序中大量使用Knockout,它与jQuery协同工作 - 在任何平台上都不会遇到任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM