unable to get intellisense for knockout.js file

断了今生、忘了曾经 提交于 2019-12-24 03:44:27

问题


i am working on asp.net website and we are using knockout.js. I am not able to get javascript intellisense for knowkcout.js file. I tried adding the below snippet but still i am not getting any intellisense.

<% if(false){ %>
    <script src="knockout-2.0.0.js" type="text/javascript"></script>
<% } %>

This is how my head block looks like:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<% if(false){ %>
    <script src="knockout-2.0.0.js" type="text/javascript"></script>
<% } %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <script src="jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
    <script src="json2.js" type="text/javascript"></script>
    <script src="knockout-2.0.0.js" type="text/javascript"></script>
    <script type="text/javascript">


    $(function() {

function viewModel() {
    firstName = ko.observable();
    lastName = ko.observable();

}

    ko.applyBindings(new viewModel());




 });
    </script>

回答1:


Put along with the knockoutjs.2.0.0.js file an other one - debug version of kcnockoutjs knockout-2.0.0.debug.js and Visual Studio would be able pick intellisense up. You do not need including this file using <script src="" .. />.

Works for me on Visual Studio 2010

Download knockout-2.0.0.debug.js — Knockout 2.0.0 (debug build) from CodePlex



来源:https://stackoverflow.com/questions/9519044/unable-to-get-intellisense-for-knockout-js-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!