Cordova学习笔记 中controller的使用及controller as的使用

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <script src="js/angular.js"></script>
    <script type="application/javascript">
        (function(angular) {
            'use strict';
            angular.module('myApp', [])
                    .controller('firstController', function firstController() {
                            this.firstNum = 1;
                            this.secondNum = 1;
                            this.doSum111 = function(){
                                return this.firstNum+this.secondNum;
                            };
                    });
        })(window.angular);
    </script>
</head>
<body >
<div ng-app="myApp">
   <div ng-controller="firstController as fc"><!--Controller As语法,简单说就是可以在Controller中使用this来替代$scope fc就相当于this了-->
        <input type="number" name="firstNum" ng-model="fc.firstNum" required/>
       +<input type="number" name="secondNum" ng-model="fc.secondNum" required/>
       ={{fc.doSum111()}}
   </div>
</div>
</body>
</html>