/// <summary> /// 获取输入控件生成器 /// </summary> private TagBuilder GetInputBuilder(TextBoxConfig config) { var builder = new InputBuilder().SetText(); builder.Attribute("placeholder", config.Placeholder); builder.Attribute("value", config.Value); builder.Attribute("type", config.Type); return(builder); }
/// <summary> /// 初始化输入控件生成器 /// </summary> private void InitInputBuilder(FormFieldBuilder formFieldBuilder, InputBuilder inputBuilder, TextBoxConfig config) { inputBuilder.SetText(); foreach (var attribute in config.GetAttributes()) { inputBuilder.Attribute(attribute.Key, attribute.Value); } inputBuilder.AddAttribute("name", config.Name); inputBuilder.AddAttribute("placeholder", config.Placeholder); inputBuilder.AddAttribute("value", config.Value); inputBuilder.AddAttribute("type", config.Type); inputBuilder.AddAttribute("[(ngModel)]", config.Model); AddValidations(formFieldBuilder, inputBuilder, config); }