Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"typescript intellisense" in my razor views?

I'm wondering if it's possible to get "typescript intellisense" in my razor views, as I have in my ts-files?

This is my app.ts file (when I type 'this.' the 'myExampleMessage' property shows up):

/// <reference path="Scripts/typings/angularjs/angular.d.ts"/>
'use strict';

var app = angular.module('app', []);

class TestController {
    constructor($scope: ng.IScope) {
        this.myExampleMessage = "Hello";
    }

    myExampleMessage: string;
}


This is my default.cshtml file (when I type 'tController.', no intellisense show up):

<!DOCTYPE html> 
<html lang="en" ng-app="app">
     <head>
         <title>TypeScript HTML App</title>
         <script src="Scripts/angular.js"></script>
         <script src="app.js"></script>
     </head>
     <body ng-controller="TestController as tController">
         <h1>TypeScript HTML App</h1>
         <div id="content">{{tController.myExampleMessage}}</div>
     </body> 
</html>

What I would like, is for Visual Studio (2013) to understand what tController is, and give me the properties defined on this class. In this case it would be the 'myExampleMessage' property.

I'm I doing something wrong, or isn't this possible?

like image 494
Oyvind Habberstad Avatar asked Dec 08 '13 22:12

Oyvind Habberstad


Video Answer


1 Answers

I'm I doing something wrong, or isn't this possible?

It isn't supported at the moment.

like image 158
basarat Avatar answered Nov 02 '22 23:11

basarat