New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Knockout extenders (client converters) #184
Conversation
Thank you, it seems to be pretty cool. I think we can merge it, @tomasherceg? |
this.propertyName = ko.observable(value).extend({ extender1 : param1, extender2 : param2}) |
I will try to prepare a patch which covers the points discussed above |
Awesome. When it's ready, we can merge it and write some tests for this. |
Hello, I've prepared second patch which covers @exyi requests :-) Small example: // C# view model class
public class ViewModel
{
// atribute has parameters: name, parameter value (optional) and order (optional)
[ClientExtender("extender1", "hello world", 2]
[ClientExtender("extender2", true, 1]
public string PropertyName { get; set; }
} Client side serialializer has ability chain declared extenders by specified order // result of executed code on client side
this.PropertyName = ko.observable(value).extend({ extender2 : true}).extend({extender1 : "hello world"}); |
I've added the first (very simple) client extender sample - password strength indicator |
Sorry it took so long time, but finally merged. Thank you. |
Basic support for knockout extenders.
Steps to activate extender:
ClientExtenderAttribute
data-bind='value: PropertyName.ExtenderName'
This patch is primarily intended for component developers (Knockout wrappers). It should be easy to expand support to the DotVVM binding syntax