• 该怎么写Angular JS



    <html ng-app>
    <head>
        <title>表单</title>
        <script type="text/javascript" src="angular.min.js"></script>
        <script type="text/javascript">
        function StartUpController($scope) {
            $scope.funding = {startingEstimate:0};
            computeNeeded = function() {
                $scope.funding.needed = $scope.funding.startingEstimate * 10;
            };
            $scope.$watch('funding.startingEstimate',computeNeeded);//watch监视一个表达式,当这个表达式发生变化时就会调用一个回调函数
            $scope.requestFunding = function() {
                window.alert("Sorry,please get more customers first.")
            };
        }
        </script>
    </head>
    <body>
        <form ng-submit="requestFunding()" ng-controller="StartUpController">  //ng-submit
            Starting: <input ng-change="computeNeeded()" ng-model="funding.startingEstimate">
            Recommendation: {{funding.needed}}
            <button>Fund my startup!</button>
        </form>
    </body>
    </html>

  • 相关阅读:
    异常
    gateway 网关
    Hystrix 图形化界面
    Hystrix 服务限流
    linux-CenOS修复内核或修改内核系统启动顺序
    Linux-CentOS不能yum update/upgrade.除非是初始环境
    Linux-CentOS配置网卡
    安装SQLSERVER2008提示错误SQL100MSI
    金蝶采购标志
    Pycharm社区版安装外部库文件
  • 原文地址:https://www.cnblogs.com/ruimeng/p/4696706.html
Copyright © 2020-2023  润新知