More about the creator: Twitter: @angustafsson
Update 1.4Added support for vs2013! Update 1.3Added options for CamelCasing and PascalCasing For more info go to: Knockout Generator 1.3
Adds a new Context menu item to your .cs/.vb files. Right click on a .cs/.vb (inside code window or in the solution window) file that has public properties, klick the new command "Generate Knockout ViewModel". When you have clicked the new command a new window will popup with options for the new Knockout ViewModel. Here is how it works, the grid on the left side shows you all the properties in the Class, the textblock on the right side shows you a preview of what will be generated. Observable Checkboxes: Will make the property observable, list, arrays will be observableArray, ordinary properties will be observable Here in the example I made the property "foo" and "fancypants", observables, because "fancyPants" is a list, it will be a observableArray, "foo" are a simple property and will therefore be an ordinary observable. When you are done, click the "Copy to clipboard" button, and you will get exactly what's in the preview box in your clipboard, paste it where you want it, function Example(example) { var self = this; self.foo = ko.observable(example.foo || ''); self.bar = example.bar; self.stringArray = example.stringArray; self.fancyPants = ko.observableArray(example.fancyPants || [ ]);} Knockout generator are easy to use and very convenient to use.
Properties that is private will not be included. |