Why does intellisense not work on my ko object?

I am testing knockout.js in a MVC3 test project. I have the following structure:

Project Root
  Scripts
    jquery-1.4.4.js
    knockout-1.2.0.debug.js
    etc...
  Views
    Home
      Index.cshtml
    Shared
      _Layout.cshtml
  HTMLPage1.htm

In my _Layout.cshtml file, I have the following script blocks:

<script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery.tmpl.js" type="text/javascript"></script>
<script src="/Scripts/knockout-1.2.0.debug.js" type="text/javascript"></script>

In my Index.cshtml file, I am trying to use the ko object in my script block. It works fine, but in VS designer I don't get any intellisense for the ko object itself.

If I open a simple HTML file at the root project level and put a script block there, I get intellisense for the ko object.

What am I wrong about? Why doesn't intellisense see the ko object in my .cshtml file?

I mark the debug output in VS, I get the following:

Javascript Intellisense : JSIntellisense: / (18: 4):
Javascript Intellisense : JSIntellisense: / (19: 8): 'ko' - undefined
Javascript Intellisense : JSIntellisense: / (18: 4):
Javascript Intellisense : JSIntellisense: / (19: 8): 'ko' - undefined
Javascript Intellisense : JSIntellisense: / (18: 4):
Javascript Intellisense : JSIntellisense: / (19: 8): 'ko' - undefined
Javascript Intellisense : JSIntellisense: / (18: 4):
Javascript Intellisense : JSIntellisense: / (19: 8): 'ko' - undefined
..

+5
1

, . , script .js .cshtml.

:

@if (false)
{
    <script src="/Scripts/knockout-1.2.0.debug.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.tmpl.js" type="text/javascript"></script>
    <script src="/Scripts/knockout-1.2.0.debug.js" type="text/javascript"></script>
}

@if (false) , ( .cshtml).

+11

All Articles