I am new in angularjs. i am using angularjs in .Net MVC razor syntax but when i load my page its gives error that is Null reference exception. Below is my Code.
@Html.TextBoxFor(model => Model.PlantCode, "PlantCode",
new { @class = "form-control", ng_model = "PlantCode",
required = "required", ng_pattern = "/^[a-zA-Z0-9_-]+$/",
oninvalid = "this.setCustomValidity(' ')",
data_ng_init = string.Format("PlantCode = '{0}'", Model.PlantCode.Replace("'", @"\'")) })
When i load page its gives Null reference exception that is Model.PlantCode is not set to an instance of an object. Please help me in finding solution. Thanks