Beispiel #1
0
 private static TBuilder Apply <TBuilder>(TBuilder builder, string label, string expression, NgBinding bindingStyle) where TBuilder : IHtmlAttributes
 {
     if (bindingStyle.HasFlag(NgBinding.AsClass))
     {
         builder.AddClass(string.Format("{0}:{1};", label, expression));
     }
     if (bindingStyle.HasFlag(NgBinding.AsAttribute))
     {
         builder.Attr(label, expression);
     }
     return(builder);
 }
Beispiel #2
0
 /// <summary>
 /// Sets the ng-disabled attribute
 /// </summary>
 public static TBuilder NgDisabled <TBuilder>(this TBuilder builder, string expression, NgBinding bindingStyle = NgBinding.AsAttribute) where TBuilder : ICheckableFormInputBuilder
 {
     return(Apply(builder, "ng-disabled", expression, bindingStyle));
 }
Beispiel #3
0
 /// <summary>
 /// Sets the ng-submit attribute
 /// </summary>
 public static TBuilder NgSubmit <TBuilder>(this TBuilder builder, string expression, NgBinding bindingStyle = NgBinding.AsAttribute) where TBuilder : IMvcFormBuilder
 {
     return(Apply(builder, "ng-submit", expression, bindingStyle));
 }
Beispiel #4
0
 /// <summary>
 /// Sets the ng-click attribute
 /// </summary>
 public static TBuilder NgClick <TBuilder>(this TBuilder builder, string expression, NgBinding bindingStyle = NgBinding.AsAttribute) where TBuilder : IHtmlAttributes
 {
     return(Apply(builder, "ng-click", expression, bindingStyle));
 }