AngularJSã¯çŸåšãæã人æ°ã®ããJavaScriptãã¬ãŒã ã¯ãŒã¯ã®1ã€ã§ãã ãã®äœ¿çšã«ããéçºããã»ã¹ãç°¡çŽ åãããAngularJSã¯å°ããªWebã¢ããªã±ãŒã·ã§ã³ãäœæããããã®åªããããŒã«ã«ãªããŸããããã¬ãŒã ã¯ãŒã¯ã®æ©èœã¯ããã«éå®ããããããŸããŸãªæ©èœã«æºã¡ã倧èŠæš¡ã¢ããªã±ãŒã·ã§ã³ãéçºã§ããŸãã éçºã®å®¹æããšå€æ°ã®æ©èœã®çµã¿åããã«ãããåºç¯ãªé
åžãè¡ãããé
åžãšãšãã«äžè¬çãªäžè¬çãªãšã©ãŒãçºçããŸããã ãã®ãããã¯ã§ã¯ãAngularJSã§å€§èŠæš¡ãããžã§ã¯ããéçºãããšãã«çºçããæãäžè¬çãªãšã©ãŒã«ã€ããŠèª¬æããŸãã
1. MVCã¢ããªã±ãŒã·ã§ã³ã«å¯Ÿå¿ãããã©ã«ããŒæ§é
AngularJSã¯MVCãã¬ãŒã ã¯ãŒã¯ã§ãã ãã®äžã®ã¢ãã«ã¯ãbackbone.jsã®å Žåã®ããã«æ瀺çã«å®çŸ©ãããŠããªããšããäºå®ã«ãããããããå
šäœçãªã¢ãŒããã¯ãã£ã¹ã¿ã€ã«ã¯åããŸãŸã§ãã MVCãã¬ãŒã ã¯ãŒã¯ã䜿çšããéã®äžè¬çãªæ¹æ³ã¯ã次ã®ãã¿ãŒã³ã«åŸã£ãŠãã¡ã€ã«ãã°ã«ãŒãåããããšã§ãã
templates/ _login.html _feed.html app/ app.js controllers/ LoginController.js FeedController.js directives/ FeedEntryDirective.js services/ LoginService.js FeedService.js filters/ CapatalizeFilter.js
ç¹ã«RoRã§ã®äœæ¥çµéšã®ããéçºè
ã®éã§ã¯ãåæ§ã®ã¢ãããŒããäžè¬çã§ãã ããã§ããã¢ããªã±ãŒã·ã§ã³ã®æé·ã«äŒŽãããã®ãããªãã©ã«ããŒæ§é ã䜿çšãããšãåæç¹ã§ããã€ãã®ãã©ã«ããŒãéãããŸãŸã«ããå¿
èŠããããŸãã SublimeãVisual StudioãVimãšNerdTreeã®ãããã䜿çšããå Žåã§ãããã£ã¬ã¯ããªããªãŒå
ã移åãããšãã¯ãåžžã«ã¹ã¯ããŒã«ã«æéãè²»ãããŸãã ãããé¿ããããã«ãã¿ã€ãã§ã¯ãªãæ©èœããšã«ãã¡ã€ã«ãã°ã«ãŒãåã§ããŸãã
app/ app.js Feed/ _feed.html FeedController.js FeedEntryDirective.js FeedService.js Login/ _login.html LoginController.js LoginService.js Shared/ CapatalizeFilter.js
ãã®ãã©ã«ããŒæ§é ã«ãããåãæ©èœã«é¢é£ããé¢é£ãã¡ã€ã«ãç°¡åã«èŠã€ããããšãã§ããéçºããã»ã¹ãã¹ããŒãã¢ããã§ããŸãã ã¯ããhtmlãã¡ã€ã«ãjsã§1ã€ã®ãã©ã«ããŒã«ä¿åããããšã¯è°è«ã®äœå°ããããŸãããæéãç¯çŽããå¹æã¯ããéèŠã§ãã
2.ã¢ãžã¥ãŒã«ïŒãŸãã¯ãã®æ¬ åŠïŒ
å€ãã®å Žåããããžã§ã¯ãéçºã®éå§æã«ããã¹ãŠã®æ©èœãåäžã®ã¢ãžã¥ãŒã«ã«è¿œå ãããŸãã ããæç¹ãŸã§ããã®ã¢ãããŒãã¯æ©èœããŸããããããžã§ã¯ãã®éçºã«äŒŽããã³ãŒãã¯ç®¡çäžèœã«ãªããŸãã
var app = angular.module('app',[]); app.service('MyService', function(){
次ã®åºç¯ãªã¢ãããŒãã¯ããªããžã§ã¯ããã¿ã€ãããšã«ã°ã«ãŒãåããããšã§ãã
var services = angular.module('services',[]); services.service('MyService', function(){
ãã®ãããªã¢ãããŒãã¯ããã€ã³ã1ã®ãã£ã¬ã¯ããªæ§é ã®ããã«ãæé©ãªæ¹æ³ã§ã¹ã±ãŒãªã³ã°ããŸãããã¹ã±ãŒã©ããªãã£ãåäžãããããã«ãã³ãŒããæ©èœã«åå²ãããšããåãæŠå¿µã«åŸããŸãã
var sharedServicesModule = angular.module('sharedServices',[]); sharedServices.service('NetworkService', function($http){}); var loginModule = angular.module('login',['sharedServices']); loginModule.service('loginService', function(NetworkService){}); loginModule.controller('loginCtrl', function($scope, loginService){}); var app = angular.module('app', ['sharedServices', 'login']);
æ©èœãç°ãªãã¢ãžã¥ãŒã«ã«åå²ãããšãããŸããŸãªãããžã§ã¯ãã§ã³ãŒããåå©çšããããšãã§ããŸãã
3.äŸåæ§æ³šå
¥
äŸåæ§æ³šå
¥ã¯ãAngularJSãæäŸããæé«ã®æ©èœã®1ã€ã§ãã DIã䜿çšãããšããã¹ããç°¡åã«ãªããŸãã AngularJSã¯ãäŸåé¢ä¿ã®å®è£
æ¹æ³ã«é¢ããŠéåžžã«æè»ã§ãã æãç°¡åãªæ¹æ³ã¯ãäŸåé¢ä¿ããã©ã¡ãŒã¿ãŒãšããŠé¢æ°ã«æž¡ãããšã§ãã
var app = angular.module('app',[]); app.controller('MainCtrl', function($scope, $timeout){ $timeout(function(){ console.log($scope); }, 1000); });
ã³ãŒããããMainCtrlã$ã¹ã³ãŒããš$ã¿ã€ã ã¢ãŠãã«äŸåããŠããããšãæããã§ãã ããã¯ããããžã§ã¯ããæ¬çªã«ç§»è¡ããã³ãŒããçž®å°ãããŸã§ãããŸãæ©èœããŸãã äžèšã®ã³ãŒãã«UglifyJSã䜿çšãããšã次ã®çµæã«ãªããŸãã
var app=angular.module("app",[]);app.controller("MainCtrl",function(e,t){t(function(){console.log(e)},1e3)})
çŸåšãAngularJSã¯MainCtrlãå®éã«äŸåãããã®ãèªèããŸããã ãããé²ãã«ã¯ããªã¹ãããããã¹ãŠã®äŸåé¢ä¿ããã©ã¡ãŒã¿ãŒãšããŠåãå
¥ããé¢æ°åœ¢åŒã®æåŸã®èŠçŽ ã䜿çšããŠãäŸåé¢ä¿ãæååã®é
åãšããŠæž¡ããšããéåžžã«ç°¡åãªè§£æ±ºçããããŸãã
app.controller('MainCtrl', ['$scope', '$timeout', function($scope, $timeout){ $timeout(function(){ console.log($scope); }, 1000); }]);
äžèšã®ã³ãŒãã¯ãMinifierã«ãã£ãŠãAngularJSããã§ã«æ£ãã解éã§ããã³ãŒãã«å€æãããŸãã
app.controller("MainCtrl",["$scope","$timeout",function(e,t){t(function(){console.log(e)},1e3)}])
3.1ã ã°ããŒãã«ãªäŸåé¢ä¿
å€ãã®å ŽåãAngularJSã¢ããªã±ãŒã·ã§ã³ãéçºãããšãã¯ãã¢ããªã±ãŒã·ã§ã³å
ã®ä»»æã®å Žæã§å©çšå¯èœãªãªããžã§ã¯ãã䜿çšããå¿
èŠããããŸãã ããã¯ãäŸåæ§æ³šå
¥ã«åºã¥ããŠçŽ°èº«ã®ã¢ãã«ãç Žå£ãããã°ãåŒãèµ·ããããã¹ãããã»ã¹ãè€éã«ããŸãã AngularJSã§ã¯ããã®ãããªãªããžã§ã¯ããã¢ãžã¥ãŒã«ã«ã©ããããŠãéåžžã®AngularJSã¢ãžã¥ãŒã«ã®ããã«åã蟌ãããšãã§ããŸãã ããšãã°ãåªããUnderscore.jsã©ã€ãã©ãªã¯ã次ã®ããã«ã¢ãžã¥ãŒã«ã«ã©ããã§ããŸãã
var underscore = angular.module('underscore', []); underscore.factory('_', function() { return window._;
ããã«ãããã¢ããªã±ãŒã·ã§ã³ã¯ãäŸåé¢ä¿ã®å¿
é å®è£
ã§åäžã®ã¹ã¿ã€ã«ã䜿çšã§ããäŸåé¢ä¿ã®æ©èœããåé¢ããŠã¢ãžã¥ãŒã«ããã¹ãããããšãå¯èœã«ãªããŸãã
4.ã³ã³ãããŒã©ãŒã®èšåŒµ
ã³ã³ãããŒã©ã¯ãAngularJSã®åºç€ã§ãã ãããŠãå€ãã®å Žåãç¹ã«åå¿è
ã¯ãã³ã³ãããŒã©ãŒã«ããŸãã«ãå€ãã®ããžãã¯ãèšè¿°ããŸãã ã³ã³ãããŒã©ãŒã¯DOMãæäœããããDOMã»ã¬ã¯ã¿ãŒãå«ãããããªãã§ãã ãã;ããã«ã¯ãã£ã¬ã¯ãã£ãããããŸãã åæ§ã«ãããžãã¹ããžãã¯ã¯ãµãŒãã¹å
ã«ãªããã°ãªããŸããã ãµãŒãã¹ã¯ã³ã³ãããŒã©ãŒãšã¯ç°ãªããã©ã€ãã¿ã€ã ãã¢ããªã±ãŒã·ã§ã³èªäœã®ã©ã€ãã¿ã€ã ãšäžèŽããã·ã³ã°ã«ããŒã³ã§ãããããããŒã¿ããµãŒãã¹ã«ä¿åããå¿
èŠããããŸãïŒããŒã¿ã$ã¹ã³ãŒãã«é¢é£ä»ããããŠããå Žåãé€ãïŒããŸããã³ã³ãããŒã©ãŒããã¥ãŒãšã¢ãã«ã®éã®ã³ãŒãã£ããŒã¿ãŒãšèŠãªããŸãããã®å Žåãæå°éã®ããžãã¯ãå«ãŸããŸãã
5.ãµãŒãã¹vså·¥å Ž
ãããã®åœåèŠåã«ãããAngularJSã®ãã¹ãŠã®åå¿è
ãæ¥ããããæããããŸãããå®éã«ã¯ã»ãšãã©åãã§ãã
function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); } function service(name, constructor) { return factory(name, ['$injector', function($injector) { return $injector.instantiate(constructor); }]); }
ãµãŒãã¹é¢æ°ã¯ããã¡ã¯ããªãŒé¢æ°ãåŒã³åºãã ãã§ãããã¡ã¯ããªãŒé¢æ°ã§ã¯ããããã€ããŒé¢æ°ã®åŒã³åºããã©ãããããŸãã ãµãŒãã¹ããã¡ã¯ããªãŒé¢æ°ãåŒã³åºãã ãã®å Žåã2ã€ã®éãã¯äœã§ããïŒ ãã€ã³ãã¯$ jector.instantiateã§ããã®äžã«$ injectorããµãŒãã¹ã³ã³ã¹ãã©ã¯ã¿ãŒé¢æ°ã®æ°ããã€ã³ã¹ã¿ã³ã¹ãäœæããŸãã åãã¢ã¯ã·ã§ã³ãå®è¡ãããµãŒãã¹ãšãã¡ã¯ããªãŒã®äŸïŒ
var app = angular.module('app',[]); app.service('helloWorldService', function(){ this.hello = function() { return "Hello World"; }; }); app.factory('helloWorldFactory', function(){ return { hello: function() { return "Hello World"; } } });
helloWorldServiceãŸãã¯helloWorldFactoryãã³ã³ãããŒã©ãŒã«æ¿å
¥ããããšãã©ã¡ãã«ããHello Worldããè¿ãåäžã®ã¡ãœãããå«ãŸããŸãã ãã¹ãŠã®ãããã€ããŒã¯ã·ã³ã°ã«ãã³ã§ããããããµãŒãã¹ã®ã€ã³ã¹ã¿ã³ã¹ãšãã¡ã¯ããªãŒã®ã€ã³ã¹ã¿ã³ã¹ã¯åžžã«1ã€ãããããŸããã ããã§ã¯ãåãæ©èœãå®è¡ããã®ã«å·¥å ŽãšãµãŒãã¹ãåæã«ååšããã®ã¯ãªãã§ããïŒ ãã¡ã¯ããªãŒã¯ãæ°ãããªããžã§ã¯ããäœæã§ããé¢æ°ãè¿ãããšãã§ãããããæè»æ§ãåäžããŸãã OOPã§ã¯ããã¡ã¯ããªã¯ä»ã®ãªããžã§ã¯ããäœæãããªããžã§ã¯ãã§ãã
app.factory('helloFactory', function() { return function(name) { this.name = name; this.hello = function() { return "Hello " + this.name; }; }; });
ãµãŒãã¹ãš2ã€ã®å·¥å Žã䜿çšããã³ã³ãããŒã©ãŒã®äŸã次ã«ç€ºããŸãã
app.controller('helloCtrl', function($scope, helloWorldService, helloWorldFactory, helloFactory) { init = function() { helloWorldService.hello();
ãã©ã€ããŒãã¡ãœããã䜿çšããŠã¯ã©ã¹ãéçºããå Žåã«ãããã¡ã¯ããªã¯äŸ¿å©ã§ãã
app.factory('privateFactory', function(){ var privateFunc = function(name) { return name.split("").reverse().join("");
6. Batarangã®äœ¿çšã®å€±æ
Batarangã¯ãAngularJSã¢ããªã±ãŒã·ã§ã³ãéçºããã³ãããã°ããããã®Chromeãã©ãŠã¶ãŒæ¡åŒµæ©èœã§ãã Batarangã§ã¯æ¬¡ã®ããšãã§ããŸãã
- ã¹ã³ãŒãã«æ¥ç¶ãããã¢ãã«ã衚瀺ãã
- ã¢ããªã±ãŒã·ã§ã³ã§äŸåé¢ä¿ã°ã©ããäœæããŸã
- ã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãåæãã
AngularJSã®ããã©ãŒãã³ã¹ã¯ãããã«ãæªããªããšããäºå®ã«ãããããããã«ã¹ã¿ã ãã£ã¬ã¯ãã£ããšè€éãªããžãã¯ãè¿œå ãããã¢ããªã±ãŒã·ã§ã³ã®æé·ã«ãããã¢ããªã±ãŒã·ã§ã³ã®é床ãäœäžãå§ããå ŽåããããŸãã Batarangã䜿çšãããšãåŒã³åºããããšãã«ã©ã®é¢æ°ãå€ãã®æéãè²»ããããç°¡åã«ææ¡ã§ããŸãã Batarangã¯ãŠã©ããããªãŒã衚瀺ããŸããããã¯ãå€æ°ã®ãŠã©ããã£ãŒã䜿çšããå Žåã«åœ¹ç«ã¡ãŸãã
7.ãªãã¶ãŒããŒãå€ããã
åè¿°ã®ããã«ãAngularJSã¯ããã«äœ¿çšã§ããŸãã ãã ãããªãã¶ãŒããŒã®æ°ã2000ã«éãããšãããŒã¿ã®å€æŽããã§ãã¯ããã$ãã€ãžã§ã¹ããµã€ã¯ã«ãã¢ããªã±ãŒã·ã§ã³ã®é床ãäœäžãããå¯èœæ§ããããŸãã 2000幎ã«éããããšã¯æžéãä¿èšŒãããã®ã§ã¯ãããŸããããå¿é
ããããšããå§ããè¯ãåºçºç¹ã§ãã 次ã®ã³ãŒãã䜿çšããŠãããŒãžããšã®ãªãã¶ãŒããŒã®æ°ã確èªã§ããŸãã
(function () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watcher) { watchers.push(watcher); }); } angular.forEach(element.children(), function (childElement) { f($(childElement)); }); }; f(root); console.log(watchers.length); })();
äžèšã®ã³ãŒããšBatarangaãªãã¶ãŒããŒããªãŒã䜿çšããŠãéè€ãããªãã¶ãŒããŒãŸãã¯äžå€ããŒã¿ã®ãªãã¶ãŒããŒããããã©ããã確èªã§ããŸãã äžå€ããŒã¿ã®å Žåã¯ãããŒãžäžã®ãªãã¶ãŒããŒã®æ°ãå¢ããªãããã«bindonceãã£ã¬ã¯ãã£ãã䜿çšã§ããŸãã
8.ã¹ã³ãŒãã®ç¶æ¿ïŒ$ã¹ã³ãŒãã®ïŒ
JSãããã¿ã€ãããŒã¹ã®ç¶æ¿ã¯ãåŸæ¥ã®ã¯ã©ã¹ç¶æ¿ãšã¯ç°ãªããŸãã éåžžãããã¯åé¡ã§ã¯ãããŸãããããããã®ãã¥ã¢ã³ã¹ã¯ã¹ã³ãŒããæäœãããšãã«çºçããå¯èœæ§ããããŸãã AngularJSã§ã¯ãéåžžã®ïŒåé¢ãããŠããªãïŒ$ã¹ã³ãŒãã芪ããæãå€ãç¥å
$ rootScopeã«ç¶æ¿ãããŸãã åãšèŠªã¹ã³ãŒãã§å
±æãããäžè¬çãªããŒã¿ã¢ãã«ã¯ããããã¿ã€ãç¶æ¿ã®ãããã§ç°¡åã«æŽçã§ããŸãã 次ã®äŸã§ã¯ããŠãŒã¶ãŒãååãå
¥åããåŸããŠãŒã¶ãŒåã2ã€ã®spanèŠçŽ ã«åæã«è¡šç€ºãããããã«ããŸãã
<div ng-controller="navCtrl"> <span>{{user}}</span> <div ng-controller="loginCtrl"> <span>{{user}}</span> <input ng-model="user"></input> </div> </div>
質åã¯æ¬¡ã®ãšããã§ãããŠãŒã¶ãŒãããã¹ãããã¯ã¹ã«ååãå
¥åãããšãnavCtrlãloginCtrlããŸãã¯ãã®äž¡æ¹ã®èŠçŽ ã衚瀺ãããŸããïŒ çããloginCtrlã®å Žåããããã¿ã€ãããŒã¹ã®ç¶æ¿ãã©ã®ããã«æ©èœããããç解ã§ããŸãã æååãã£ãŒã«ãæ€çŽ¢ã§ã¯ããããã¿ã€ããã§ãŒã³ã¯äœ¿çšãããŸããã ç®çã®åäœãå®çŸããã«ã¯ããªããžã§ã¯ãã䜿çšããŠãåããã³èŠªã®$ã¹ã³ãŒãã®ãŠãŒã¶ãŒåãæ£ããæŽæ°ããããšããå§ãããŸãã ïŒJSã§ã¯ãé¢æ°ãšé
åããªããžã§ã¯ãã§ããããšãæãåºããŸããïŒ
<div ng-controller="navCtrl"> <span>{{user.name}}</span> <div ng-controller="loginCtrl"> <span>{{user.name}}</span> <input ng-model="user.name"></input> </div> </div>
ããã§ããŠãŒã¶ãŒå€æ°ããªããžã§ã¯ãã§ããããããããã¿ã€ããã§ãŒã³ãæ©èœããnavCtrlã®spanèŠçŽ ãloginCtrlãšå
±ã«æ£ããæŽæ°ãããŸãã ããã¯äžèªç¶ãªäŸã®ããã«æãããããããŸããããåã¹ã³ãŒãïŒngRepeatãªã©ïŒãäœæãããã£ã¬ã¯ãã£ãã䜿çšãããšããã®ãããªç¬éãçºçããŸãã
9.æåãã¹ãã®äœ¿çš
äœæ¥ã§TDDã®äœ¿çšãéå§ãããŸã§ãæ¯åãããžã§ã¯ããå®è¡ããæåãã¹ããå®è¡ããŠã³ãŒããæ©èœããããšã確èªããå¿
èŠããããŸãã ãã®ã¢ãããŒããAngularJSã§äœ¿çšããèšãèš³ã¯ãããŸããã AngularJSã¯ãæåã«éçºãããã³ãŒãããã¹ãå¯èœã«ãªãããã«èª¿æŽãããŸããã DIãngMockã¯ãããã«é¢ããæåã®ãã«ããŒã§ãã ãŸãã次ã®ã¬ãã«ã«é²ãããã®ããŒã«ãããã€ããããŸãã
9.1å床åš
åäœãã¹ãã¯ãå®å
šã«ã«ããŒããããã¹ãã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®åºç€ã§ããããããžã§ã¯ãã®æé·ã«äŒŽããçµ±åãã¹ãã®äœ¿çšã¯ãã¢ããªã±ãŒã·ã§ã³å
ã®ã³ãŒãã®å®è¡å¯èœæ§ã確èªããããã«ããå¹æçã«ãªããŸãã 幞ããªããšã«ãAngularJSããŒã ã¯åªããããŒã«ãéçºããŸãã-Protractorã¯ããŠãŒã¶ãŒã®æäœãã·ãã¥ã¬ãŒãã§ããŸãã å床åšã¯ããã¹ãã®äœæã«Jasmineãã¬ãŒã ã¯ãŒã¯ã䜿çšããããŸããŸãªçžäºäœçšã·ããªãªãèšè¿°ããããã®åªããAPIãåããŠããŸãã å€ãã®ç°ãªããã¹ãããŒã«ã®äžã§ãProtractorã«ã¯AngularJSã®å
éšæ§é ãç解ã§ãããšããå©ç¹ããããŸããããã¯ã$ãã€ãžã§ã¹ãã«ãŒããªã©ãæ±ãå Žåã«ç¹ã«äŸ¿å©ã§ãã
9.2ã ã«ã«ã
AngularJSãããžã§ã¯ãããŒã ã¯ããã¹ãéçºããŒã«ã®äœæã«éå®ãããŸããã§ããã ãã¹ãã©ã³ããŒã®KarmaãéçºãããŸããã Karmaã§ã¯ããœãŒã¹ãã¡ã€ã«ãå€æŽãããã³ã«ãã¹ããå®è¡ã§ããŸãã Karmaã¯ãè€æ°ã®ãã©ãŠã¶ãŒã§äžŠè¡ããŠãã¹ããå®è¡ã§ããŸãã ããŸããŸãªããã€ã¹ãã«ã«ããµãŒããŒãã¿ãŒã²ããã«ããŠãå®éã®äœ¿çšã·ããªãªãããå®å
šã«ã«ããŒããããšãã§ããŸãã
10. jQueryã䜿çšãã
jQueryã¯çŽ æŽãããã©ã€ãã©ãªã§ãã ã¯ãã¹ãã©ãããã©ãŒã éçºãæšæºåããææ°ã®Webéçºã®æšæºã«ãªããŸããã jQueryã«ã¯å€ãã®æ©èœããããšããäºå®ã«ããããããããã®å²åŠã¯AngularJSã®å²åŠãšã¯ããé¢ããŠããŸãã AngularJSã¯ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®ãã¬ãŒã ã¯ãŒã¯ã§ãããjQueryã¯JavaScriptããã³HTMLãšã®å¯Ÿè©±ããã»ã¹ãåçŽåããã©ã€ãã©ãªã§ãããAJAXãæäœããããã®äŸ¿å©ãªAPIãæäŸããŸãã ããã2ã€ã®åºæ¬çãªéãã§ãã Angularã¯ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®ã¢ãããŒãã§ãããããã¥ã¡ã³ãã®ã¬ã€ã¢ãŠããå¶åŸ¡ããæ¹æ³ã§ã¯ãããŸããã AngularJSã¢ããªã±ãŒã·ã§ã³æ§ç¯ã®ååãæ¬åœã«ç解ããã«ã¯ãjQueryã®äœ¿çšãåæ¢ããå¿
èŠããããŸãã jQueryã䜿çšãããšãæ¢åã®HTMLæšæºã«æºæ ã§ããããã«ãªããŸãããangularã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããŒãºã«åãããŠHTMLæšæºãæ¡åŒµã§ããŸãã AngularJSã§ã®DOMæäœã¯ãã£ã¬ã¯ãã£ãã§è¡ãå¿
èŠããããŸãããAngularã§ã¢ããã°ãèŠã€ãããªãå Žåã¯ããã£ã¬ã¯ãã£ãã®æ¢åã®jQueryã³ã³ããŒãã³ãã«ã©ãããŒãé
眮ããããšã¯å®å
šã«åãå
¥ããããŸãã
ãããã«
AngularJSã¯ããã°ãããã³ãã¥ããã£ãåããã絶ããé²åããŠãããã°ããããã¬ãŒã ã¯ãŒã¯ã§ãã 人æ°ã®ãããšã©ãŒã®ãªã¹ããããªãã®ä»äºã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãã