• angularJs之模块化


    <!DOCTYPE HTML>
    <html ng-app="myApp">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>无标题文档</title>
    <script src="angular.min.js"></script>
    <script>

    /*var m1 = angular.module('myApp',[]);
    m1.controller('Aaa',function($scope){
    $scope.name = 'hello';
    });
    m1.controller('Bbb',function($scope){
    $scope.name = 'hi';
    });*/

    var m1 = angular.module('myApp',[]);
    m1.controller('Aaa',['$scope',function($scope){
    $scope.name = 'hello';
    }]);
    m1.controller('Bbb',['$scope',function($scope){
    $scope.name = 'hi';
    }]);

    /*
    function Aaa($scope){
    $scope.name = 'hello';
    }
    function Bbb($scope){
    $scope.name = 'hi';
    }*/

    </script>
    </head>

    <body>
    <div ng-controller="Aaa">
    <p>{{name}}</p>
    </div>
    <div ng-controller="Bbb">
    <p>{{name}}</p>
    </div>

    </body>
    </html>

  • 相关阅读:
    属性包装
    生成器
    迭代器
    深拷贝-浅拷贝
    装饰器-wrapper
    类别不均衡
    参数优化-学习曲线
    参数优化-验证曲线
    参数优化-API
    D. Number Of Permutations 符合条件的排列种类
  • 原文地址:https://www.cnblogs.com/songyunxinQQ529616136/p/6204208.html
Copyright © 2020-2023  润新知