如下所示:
ng-model="name" //填寫的數(shù)據(jù)提交到index.php
index.html
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="angular.min.js"></script> </head> <body> <div ng-app="module" ng-controller="ctrl"> //form表單提交 <form action="index.php" method="post"> <input type="text" name="title" ng-model="name"> {{name}} <input type="submit"> </form> </div> <script> var m = angular.module('module', []); m.controller('ctrl', ['$scope', function ($scope) { $scope.name = '泠泠在路上'; }]); </script> </body> </html>
index.php
<?php print_r($_POST);
以上這篇angularJs提交文本框數(shù)據(jù)到后臺(tái)的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com