我正面临着Angular和Ionic的问题。我有以下代码段:
控制器:
<head runat="server">
<title></title>
<script type="text/javascript">
function IsValidUrl()
{
var emailbox = document.getElementById('<%=TextBox4.Text %>');<!--textbox4 is used to receive the email entered by the user-->
var email = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if (textbox.value.length > 0)<!--the email field should be non empty-->
{
if (email.test(emailbox.value))
{
return true;
}
else
{
alert("Please enter valid Email");<!--incase of an invalid email-->
return false;
}
}
else
{
alert("please enter text");
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" style="margin-left: 340px" Text="Submit" Width="96px" OnClick="Button1_Click1" OnClientClick="javascript:IsValidUrl();"/>
</form>
</body>``
HTML:
app.controller('CatagoryItemsContoller', ['$scope', function($scope) {
'use strict';
$scope.stringArr = ["Yes","No","MayBe"];
$scope.selectedItem = "Yes";
}]);
我总是得到一个空的选择框。这里发生了什么?
注意:我通过角度路由登陆此页面。
答案 0 :(得分:2)
ng-model 而非 ng-modal
更改
发件人:强>
<select ng-modal="selectedItem" ng-options="o as o for o in stringArr"></select>
要强>
<select ng-model="selectedItem" ng-options="o as o for o in stringArr"></select>
工作Plunker