Skip to content
dotnetwise edited this page Mar 25, 2013 · 10 revisions

3 Simple steps:

  1. Download _vs2012.intellisense.js and NamespacesAndEnumSupport.js
  2. Add reference at the beggining of your js file (or in global Scripts/_references.js if you are using one)
/// <reference path="_vs2012.intellisense.js" />
  1. Start coding! The following could be a good try to test the features
/// <reference path="_vs2012.intellisense.js" />
!function () {

	namespace("Demo.controllers")

	function Class() {
		this.onClick = function () { },
		this.thisUndefined = undefined;
		this.thisNumber = 1;
		this.thisString = "";
		this.thisBoolean = true;
		this.thisNull = null;
		this.thisObject = {};
		this.thisFunction = function () { };
		this.thisRegExp = /a/g;
		this.thisDomElement = document.body;
		this.thisClass = Class;
		this.thisClassInstance = new Enumerator();
		this.thisNamespace = Namespace;
		this.thisEnum = Color.Red;
	}
	Class.__class = true;
	Class.prototype.protoMethod = function () { };
	Class.prototype.protoFieldObject = {};
	Class.prototype.protoFieldBool = false;
	function IUser() { }
	IUser.__interface = true;
	Demo.controllers.function = function () { };
	

	var map = {}
	map.__map = true;
	var colors = new Enum({ Red: 1, Yellow: 2, Green: 3 });
	colors.Red;

	Demo.Class = Class;
	Demo.colors = colors;
	Demo.IUser = IUser;
	Demo.map = map;
	Demo.fieldFunction = function () { }
	Demo.fieldBoolean = false;
	Demo.fieldString = "";
	Demo.fieldNumber = 1;

	var c = new Class();
	
	//uncomment any of these lines to test:
	//Demo.
	//Class.
	//c.

}();

Results

You should see something like:

ns.

namespace

Class.

Class

c.

Class githalytics.com alpha

Clone this wiki locally