This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class {{clazz}} { | |
constructor( | |
{{#params}} | |
{{> param}} | |
{{/params}} | |
) { | |
{{#attribs}} | |
{{> attrib}} | |
{{/attribs}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Type { | |
static isBoolean(val) { | |
return typeof(val) === 'boolean'; | |
} | |
static isNull(val) { | |
return val === null; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function objToJson (obj, rootName) { | |
var root = {}; | |
root[rootName] = {}; | |
objToJsonRecursive(root[rootName], obj); | |
return root; | |
} | |
function objToJsonRecursive(root, obj) { | |
for (var key in obj) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createXML(json, rootName) { | |
var doc = document.implementation.createDocument(null, null, null); | |
var rootNode = doc.createElement(rootName); | |
var xml = createXMLRecursive(doc, rootNode, json); | |
return doc.appendChild(xml); | |
} | |
function createXMLRecursive(doc, node, json) { | |
for (var literal in json) { | |
// for string literals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modalDialog = $('#dialogDiv').dialog({ | |
autoOpen: false, | |
open: function () { | |
// Destroy Close Button (for subsequent opens) | |
$('#dialog-div-close').remove(); | |
// Create the Close Button (this can be a link, an image etc.) | |
var link = '<a id="dialog-div-close" href="#" style="float:right;text-decoration:none;">Close</a>'; | |
// Create Close Button | |
$(this).parent().find(".ui-dialog-titlebar").append(link); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = {}; | |
obj.TestString = "Test"; | |
obj.TestInt = 1; | |
obj.TestBool = true; | |
$.ajax({ | |
type: 'POST', | |
url: '@Url.Action("Test", "Test")', // replace this with the name of the controller and model | |
data: JSON.stringify(obj), | |
dataType: "html", | |
success: function (html) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult TestController(TestModel model) { | |
// TODO logic here... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestModel() | |
{ | |
public string TestString {get; set;} | |
public int TestInt {get; set;} | |
public bool TestBool {get; set;} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: 'POST', | |
data: xmlString, | |
contentType: 'application/xml', | |
dataType: 'json', | |
success: function (data) { | |
alert('SOAP Request:' + data); | |
} | |
}); |
NewerOlder