I suggest you ...

Knockout Intellisense for databinding to a specific ViewModel using Design Time Comment like in XAML

It would be helpful if they allowed you to add a html comment specialized in letting the designer know that a specific region is using a specific JavaScript file that represents the view model. That way when the designer can’t figure it out, we can override it to be very specific. This would be very similar to the design time XAML syntax you can use to tell it the data bind type.

159 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Corey GaudinCorey Gaudin shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Brandon WittwerBrandon Wittwer commented  ·   ·  Flag as inappropriate

        Great news that this will be implemented! My views are stored as individual HTML files and share a folder naming convention which could be used to correlate them to their companion viewmodels. They're implemented with https://github.com/ifandelse/Knockout.js-External-Template-Engine/

        Either way it seems like a comment tag which can point to a namespace to find the viewModel that a view should be associated to would be perfect. Something like

        <!- - ///<knockoutVM location="myapp.viewModels.ThisViewsModel" /> - ->

        I'm sure there would be a better way to write the tag than my mishmash of html+js comments but you get the gist.

        Thanks for all your work on Web Essentials and WebTools. I get so excited when I see that one of them is updated! Keep it up!

      • Corey GaudinCorey Gaudin commented  ·   ·  Flag as inappropriate

        Thanks Mads. You are awesome! Keep up the amazing work you guys are putting out. Its mind blowing how great things are in the ASP.NET world and how fast we are moving forward.

      Feedback and Knowledge Base