Borang AngularJS ialah koleksi kawalan input.
Borang AngularJS sintaks
Elemen input HTML berikut dipanggil kawalan HTML:
elemen input
elemen pilih
elemen butang
elemen textarea
Borang AngularJS contoh
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script> </head> <body> <div ng-app="myApp" ng-controller="formCtrl"> <form> First Name: <input type="text" ng-model="firstname"> </form> </div> <script> var app = angular.module('myApp', []); app.controller('formCtrl', function($scope) { $scope.firstname = "John"; }); </script> </body> </html>
Run Instance »
Klik butang "Run Instance" untuk melihat instance dalam talian