嗨,我是angular js的新手,我有一个aspx页面,其中我有一个div标签,它由login div和其他div标签组成。
我将ng-app和ng-controller设置为main div标签,我使用了update panel和scriptmanager,上面有一个form标签。但是当我试图在一个无效的模式上显示一个div时,div没有显示在下面是我的html
<body onload="heightpx()">
<form name="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="chatwindow" ng-cloak ng-app="s" ng-controller="sChat" class="col-md-4 col-xs-12" style="height: 100%; position: absolute; padding: 0px; float: right; bottom: 0px; right: 0px; z-index: 10001; background: #FFF; border: 1px solid #898989">
<div id="loginform" class="col-md-11 col-xs-11" ng-show="Islogin==false && ExistingCustomer==true" style="margin-top: 5px;">
<div class="form-group">
<input type="text" ng-model="Name" name="Name" placeholder="Name" class="form-control" id="uname" onkeyup="euname();" required ng-pattern="/^(?:[0-9]{1,3}\.){3}/" />
<div class="custom-error" ng-show="form1.Name.$error.pattern">Not a valid subnet, should be i.e. 10.x.y. (3 bytes only)</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>发布于 2016-11-20 22:44:38
您的Form1超出了angular的范围。因此,angular编译器不会读取这种形式。你可以在angular应用中创建表单标签(LoginForm),然后使用loginForm.Name.$error.pattern。它应该是可行的
https://stackoverflow.com/questions/40705235
复制相似问题