我试图点击“删除”按钮,只有将鼠标悬停在ng-repeat元素上才会显示。
public class DecimalModelBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
ValueProviderResult valueResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
ModelState modelState = new ModelState { Value = valueResult };
object actualValue = null;
try
{
actualValue = Convert.ToDecimal(valueResult.AttemptedValue, CultureInfo.CurrentCulture);
}
catch (FormatException e)
{
modelState.Errors.Add(e);
}
bindingContext.ModelState.Add(bindingContext.ModelName, modelState);
return actualValue;
}
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
//HERE you tell the framework how to handle decimal values
ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder());
DependencyResolver.SetResolver(new ETAutofacDependencyResolver());
}
每次都会给我错误: 失败:索引越界。尝试访问index:5处的元素,但只有5个元素匹配定位器By(css选择器,[ng-click =“deleteTemplate(template)”]) 或 元素不可见。
答案 0 :(得分:2)
首先,您在浏览器操作链之后缺少EC
(请注意,如果您使用了eslint-plugin-protractor
ESLint插件,之前就已经发现它了 - 有一个{{3 }})。
并且,在移动鼠标后,尝试等待元素可点击:
var EC = protractor.ExpectedConditions;
其中./view-news.component.css
定义为:
<form id="upload-profile-form" data-parsley-validate enctype="multipart/form-data"
name = "uploadBatchForm"
class="form-horizontal form-label-left"
>