AngularJS的helloworld,angularjs

來源:互聯網
上載者:User

AngularJS的helloworld,angularjs

<!DOCTYPE html><html><body><div ng-app="" ng-init="firstName='John'"><p>姓名為 <span ng-bind="firstName"></span></p></div><script src="angular-1.0.1.min.js"></script></body></html>
angular-1.0.1.min.js的:http://download.csdn.net/detail/zl544434558/8015741

AngularJS的核心思想是什?適用於什類型的應用?怎快速入門?

核型思想是MVC,即Model->Controler->View 。模型,通過控制器控制視圖

以直接操作資料模型來代替傳統的 改資料對象再改頁面DOM的模式

適用於高度複雜物件模型的單頁面APP
 
怎使用angularjs實現文字框擷取焦點

可以寫個指令
<!DOCTYPE html><html ng-app="myApp"><head><title>angularjs-focus</title></head><body><input type="text" set-Focus=""><script type="text/javascript" src="js/angular.min.js"></script><script type="text/javascript">var myApp = angular.module('myApp',[]);myApp.directive('setFocus', function(){ return function(scope, element){ element[0].focus(); };});</script></body></html>
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.