Untuk dapat menggunakan custom built editor template, pastikan terlebih dahulu terdapat file-file berikut.
- ~/Infrastructure/Abstract/IObjectExtender.cs
- ~/Infrastructure/Concrete/ObjectExtender.cs
- ~/Extension/HtmlExtensions.cs
Untuk cara penggunaan sendiri:
Textbox
[code lang=”html”]
@Html.AngularEditorFor(<expression>, <ngModel>, <htmlAttributes | optional>)
[/code]
Example:
[code lang=”html”]
@Html.AngularEditorFor(model => model.Test, "val.test", new { @class = "" })
[/code]
Numeric Textbox
[code lang=”html”]
@Html.AngularEditorFor(<expression>, <ngModel>, <htmlAttributes | optional>)
[/code]
Example:
[code lang=”html”]
@Html.AngularEditorFor(model => model.TestNumber, "val.test_number", new { @class = "" })
[/code]
Datepicker
[code lang=”html”]
@Html.AngularEditorFor(<expression>, <ngModel>, <htmlAttributes | optional>)
[/code]
Example:
[code lang=”html”]
@Html.AngularEditorFor(model => model.TestDate, "val.test_date", new { @class = "" })
[/code]
Checkbox
[code lang=”html”]
@Html.AngularCheckboxFor(<expression>, <ngModel>, <htmlAttributes | optional>, <ngTrueValue | optional>, <ngFalseValue | optional>)
[/code]
Example:
[code lang=”html”]
@Html.AngularCheckboxFor(model => model.TestBoolean, "val.test_boolean", new { @class = "" })
@Html.AngularCheckboxFor(model => model.TestBoolean, "val.test_boolean", new { @class = "" }, "’YES’", "’NO’")
@Html.AngularCheckboxFor(model => model.TestBoolean, "val.test_boolean", new { @class = "" }, "{val : true}", "{val: false}")
[/code]
Radio Button
[code lang=”html”]
@Html.AngularRadioButtonFor(<expression>, <ngModel>, <value>, <htmlAttributes | optional>, <ngValue | optional>)
[/code]
Example:
[code lang=”html”]
@Html.AngularRadioButtonFor(model => model.Icon, "val.icon", "glyphicon-plus")
[/code]