Angular——表单指令

基本介绍

这些指定只能针对input标签

基本使用

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body ng-app="App">
<div ng-controller="DemoController">
    <input type="text" ng-disabled="true"><br>
    <input type="text" ng-readonly="true"><br>
    <input type="checkbox" ng-checked="true"><br>
    <select>
        <option>日本</option>
        <option>中国</option>
        <option>美国</option>
        <option ng-selected="true">俄罗斯</option>
    </select>
</div>
<script src="../libs/angular.min.js"></script>
<script>
    var App = angular.module('App', []);
    App.controller('DemoController', ['$scope', function ($scope) {

    }]);
    // ng-disabled:表单禁用
    // ng-readonly:表单只读
    // ng-checked:单/复选框表单选中
</script>
</body>
</html>
原文地址:https://www.cnblogs.com/wuqiuxue/p/8410448.html