欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

使用angular寫(xiě)一個(gè)hello world

 更新時(shí)間:2015年01月23日 10:39:59   投稿:hebedich  
這篇文章主要介紹了使用angular寫(xiě)一個(gè)hello world的方法及示例,需要的朋友可以參考下

angularjs遵循MVC模式,慣例來(lái)一個(gè)hello world吧

復(fù)制代碼 代碼如下:

<html ng-app>
<head>
    <script type="text/javascript" src="angular.min.js"></script>
    <script type="text/javascript" src="controllers.js"></script>
</head>
<body>
    <div ng-controller='HelloController'>
        <p>{{greeting.text}}, world</p>
    </div>
</body>
</html>

controllers.js中的內(nèi)容

復(fù)制代碼 代碼如下:

function HelloController($scope) {
    $scope.greeting = { text: "Hello"};
}

MVC寫(xiě)起來(lái)很不錯(cuò)的感覺(jué)~~

相關(guān)文章

最新評(píng)論