美文网首页
内置命令

内置命令

作者: 晨雪落客 | 来源:发表于2019-03-14 16:15 被阅读0次

<!DOCTYPE html>

<html lang="en">

<head>

<meta  charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0">

<title>angular gtest</title>

<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>

<link rel="stylesheet" href="//cdn.jsdelivr.net/foundation/4.3.2/css/foundation.min.css">

<style>

.odd{

background-color:red;

}

.even{

background-color:green;

}

.first{

background-color:yellow;

}

.last{

background-color:aqua;

}

</style>

</head>

<body ng-app="myApp">

<div ng-controller="myController">

Your email

匹配字母:


click me

-->

    <hr>

    <p>姓名:<input type="text" name="username" ng-model="username" ng-readonly="isRead"></p>

    <p>年龄:<input type="text" name="age" ng-model="age" ng-disabled="isDisable"></p>

<hr>

<label>Select city:</label>

<input type="checkbox" ng-model="isTwoFish"><br/>

<select>

<option>上海</option>

<option ng-selected="isTwoFish">北京</option>

<option>郑州</option>

<option>商丘</option>

</select>

<hr>

    <input type="text" ng-model="pname">

<div ng-switch on="pname">

<p ng-switch-default>Bowen</p>

<h1 ng-switch-when ="jy">{{pname}}</h1>

</div>

<hr>

    <div ng-if="2+2==5">

<p>Hello,2+2= 5</p>

</div>

<div ng-if="2+2 == 4">

<p>Hello, 2+2 =4</p>

</div>

<hr>

    <div ng-repeat="person in people" ng-class="{even: !$even,odd: !$odd,first: $first,last: $last}">

<p>

{{person.username}} lives {{person.city}}

</p>

</div>

<hr>

    <div>

<input type="text" ng-model ="p.x" ng-change="changeReslt()" >

<code>{{p.y}}</code>

</div>

</div>

</body>

<script type="text/javascript">

var myApp = angular.module("myApp",[]);

myApp.controller("myController",function($scope){

$scope.username ="lisi";

if($scope.username =="lisi"){

$scope.isRead =true;

}else{

$scope.isRead =false;

}

$scope.age =20;

if($scope.age ==20){

$scope.isDisable =true;

}else{

$scope.isDisable =false;

}

//ng-repeat 现实遍历颜色变化

    $scope.people = [{"username":"zhangsan","city":"shanghai"},{"username":"lisi","city":"beijing"},

{"username":"zhaoliu","city":"shangqiu"},{"username":"xiaoqi","city":"yucheng"}];

//ng-change 事件

    $scope.changeReslt =function(){

$scope.p.y =parseInt($scope.p.x)+2;

}

});

</script>

</html>

相关文章

  • Linux命令帮助

    命令 Command type 显示指定命令属于那种类型 命令类型: 内置命令(shell内置,sh...

  • 如何在linux系统上获取命令的帮助信息,man文档的章节划分

    内置命令获取帮助文档的方式: 判断一个命令是否是Linux内置的,可以用type命令,只有Linux的内置命令才能...

  • linux 内置命令 / 外置命令

    内置命令 / 外置命令 内置命令:系统启动就加载如内存, 效率高, 占资源不会开启子进程执行内置命令和 shell...

  • 9、常用命令使用

    linux命令类型一般分为两种:内置命令和外部命令 1. 内置命令:在shell中内部建立的命令...

  • Bash Shell 内置变量命令

    Bash Shell 内置变量命令 常用的内置命令:echo、eval、exec、export 、read 、sh...

  • 内置命令

    angular gtest .odd{ background-color:red;...

  • Git 的安装与配置

    安装不需要安装,Git Bash 内置了 Git 命令,Git Bash 还内置了以下命令: lsmkdircpm...

  • 09.SpringShell内置命令-禁用内置命令

    SpringShell 2.0 共为我们提供了五个内置命令, 如果不想使用, 那么可以禁用内置命令. 笔者并不推荐...

  • git 入门

    1、git的安装 安装:不需要安装,Git Bash 内置了 Git 命令,Git Bash 还内置了以下命令:...

  • linux(七)

    type命令 输出命令类型 buildin 内置命令 alias 别名 file 外置命令 shell快捷键 跳脱...

网友评论

      本文标题:内置命令

      本文链接:https://www.haomeiwen.com/subject/dflcmqtx.html