在本例中的頂部按鈕不會在IE 8.底部一個確實工作。 我有什麼要添加到/改變這個例子中,使頂部按鈕在IE8的作品呢?如何獲得這種形式從角度提交?
<html ng-app>
<head>
<script>
function form_controller($scope) {
$scope.my_submit = function() {
alert("Using angular");
document.my_form.method = document.my_form.method_x.value;
document.my_form.action = document.my_form.action_x.value;
alert(document.my_form.method);
alert(document.my_form.action);
alert("submitting");
document.my_form.submit();
}
}
function my_submit() {
document.my_form.method = document.my_form.method_x.value;
document.my_form.action = document.my_form.action_x.value;
alert(document.my_form.method);
alert(document.my_form.action);
alert("Using normal form : submitting");
document.my_form.submit();
return(false);
}
</script>
</head>
<body>
<form ng-controller="form_controller" name="my_form">
<input type="button" value="testing" ng-click="my_submit()"/><br/>
<input type="button" value="testing" onclick="my_submit()"/><br/>
<input type="hidden" name="method_x" value="post"/>
<input type="hidden" name="action_x" value="http://www.yahoo.com"/>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.js"></script>
</body>
請仔細閱讀各地形式角文檔。您使用角度'$ http'服務提交模型。你在做什麼是沒有棱角的方式,在這裏看到http://docs.angularjs.org/guide/forms – Chandermani