• Angular(数组的操作)


    html部分

    ..............................................

    <!doctype html>
    <html ng-app="myApp">
    <head>
    <meta charset="UTF-8">
    <title>AngularJS Expressions</title>
    <style>
    a{color: blue; text-decoration: underline; cursor: pointer}
    </style>

    </head>
    <body>
    <div ng-controller="myController">
    1.表达式与作用域交互<br>
    {{speed}} {{vehicle}}<hr>

    2.访问作用域中的变量:<br>
    {{speed + ' ' + vehicle}}<hr>

    3.调用作用域中的函数:<br>
    {{lower(speed)}} {{upper('Jeep')}}<hr>

    <a ng-click="setValues('Fast', newVehicle)">
    Click to change to Fast {{newVehicle}}</a><hr>
    <a ng-click="setValues(newSpeed, 'Rocket')">
    Click to change to {{newSpeed}} Rocket</a><hr>
    <a ng-click="vehicle='Car'">
    Click to change the vehicle to a Car</a><hr>
    <a ng-click="vehicle='Enhanced' + vehicle">
    Click to Enhance Vehicle</a><hr>
    </div>
    <script src="js/angular-1.3.0.js"></script>
    <script src="js/day2_text8.js"></script>
    </body>
    </html>
    ..................................
    js部分

    angular.module('myApp', [])
    .controller('myController', function($scope) {
    $scope.speed = 'Slow';
    $scope.vehicle = 'Train';
    $scope.newSpeed = 'Hypersonic';
    $scope.newVehicle = 'Plane';
    $scope.upper=function(aString){
    return angular.uppercase(aString);
    };
    $scope.lower = function(aString){
    return angular.lowercase(aString);
    };
    $scope.setValues = function(speed, vehicle){
    $scope.speed = speed;
    $scope.vehicle = vehicle;
    };
    });
  • 相关阅读:
    重要网址(工具的使用)
    navicat的使用(测试库和正式库同步)以及用plsql改表字段属性
    linux
    linux一些基本命令
    LINUX的一些基本概念和操作
    LINUX简介
    Redis系统管理
    Redis之数据类型
    Redis的简介与安装
    论文阅读笔记(二十七)【AAAI2019】:A Bottom-Up Clustering Approach to Unsupervised Person Re-Identification
  • 原文地址:https://www.cnblogs.com/YoogaChan/p/6920527.html
Copyright © 2020-2023  润新知