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 ($) { | |
$.fn.carregaOptions = function(configs) { | |
var defaults = { | |
options : [], | |
template: function(val) { | |
return '<option value="{0}">{1}</option>'.format(val[0], val[1]); | |
} | |
}; | |
return this.each(function(val) { |
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
Func<T, bool> GetExpressionOfEquals<T>(string propertyName, string equalsTo) | |
{ | |
var parameter = Expression.Parameter(typeof(T)); | |
var property = Expression.Property(parameter, propertyName); | |
var binaryExpression = Expression.Equal(property, Expression.Constant(equalsTo)); | |
var lambda = Expression.Lambda<Func<T, bool>>(binaryExpression, "Teste", new[] { parameter }); | |
var expression = lambda.Compile(); | |
return expression; |
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
String.prototype.format = String.prototype.format || function(){ | |
var format = this; | |
for (var i = 0; i < arguments.length; i++) { | |
var arg = arguments[i]; | |
if (arg === null || arg === undefined) arg = ""; | |
var regex = new RegExp("\\{" + i + "\\}", "g"); | |
format = format.replace(regex, arg); | |
} | |
return format; | |
}; |
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
<template> | |
<require from="./grid.html"></require> | |
<grid | |
data.bind="list" | |
config.bind="config" | |
> | |
</grid> | |
</template> |
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
<template> | |
<h1>Dialog Repro</h1> | |
<button click.delegate="dt.openDialogA()">Open Dialog</button> | |
</template> |