{"id":848,"date":"2016-09-20T23:42:40","date_gmt":"2016-09-20T15:42:40","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=848"},"modified":"2016-09-22T21:25:08","modified_gmt":"2016-09-22T13:25:08","slug":"angularjs%e5%85%a5%e9%97%a8%e6%95%99%e7%a8%8b%e4%b8%80","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=848","title":{"rendered":"AngularJS\u5165\u95e8\u6559\u7a0b(\u4e00)\u7279\u6027\u548c\u6a21\u5757"},"content":{"rendered":"<p>\n\tAngularJS 2.0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u638c\u63e1AngularJS 1.x\u7684\u57fa\u672c\u77e5\u8bc6\u80fd\u66f4\u5feb\u7684\u5e2e\u52a9\u6211\u4eec\u8fc8\u5165AngularJS 2.0\u7684\u6000\u62b1\uff0c\u8ba9\u6211\u4eec\u4e0d\u5fd8AngularJS 1.x\u521d\u5fc3\uff0c\u53bb\u62e5\u62b1AngularJS 2.0\u7684\u7f8e\u597d\u672a\u6765\u3002\u672c\u7cfb\u5217\u6587\u7ae0\u5c06\u5f7b\u5e95\u7684\u8bb2\u89e3AngularJS\u7684\u5b9e\u6218\u5f00\u53d1\u3002\n<\/p>\n<h2>\n\tAngularJS\u662f\u4ec0\u4e48<br \/>\n<\/h2>\n<p>\n\t\u6211\u4eec\u77e5\u9053HTML\u662f\u4e00\u79cd\u521b\u5efa\u7f51\u9875\u7684\u9759\u6001\u6807\u8bb0\u8bed\u8a00\uff0c\u5b83\u5f88\u57fa\u7840\uff0c\u4f46\u4e0d\u5931\u7075\u6d3b\uff0c\u7136\u800c\u5b83\u81ea\u8eab\u5e76\u4e0d\u63d0\u4f9b\u5bf9\u7075\u6d3b\u6027\u7684\u5177\u4f53\u5b9e\u73b0\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u521b\u5efa\u5177\u6709\u53ef\u7528\u6027\u53ca\u8d4f\u5fc3\u60a6\u76ee\u7684Web\u5e94\u7528\u5c31\u9700\u8981\u4f7f\u7528\u5176\u4ed6\u8bed\u8a00\u4e0e\u4e4b\u7ed3\u5408\u53bb\u64cd\u63a7\u5b83\u7684DOM\u3001\u6807\u7b7e\u3001\u6807\u7b7e\u5c5e\u6027\u3001\u6807\u7b7e\u5c42\u7ea7\u7ed3\u6784\u5b9e\u73b0\u6837\u5f0f\u53d8\u6362\u3001\u52a8\u6001\u6570\u636e\u53d8\u6362\u3001\u52a8\u6001\u5143\u7d20\u53d8\u6362\u7b49\uff0c\u6bd4\u5982\u7ed3\u5408CSS\u548cJavaScript\u8bed\u8a00\u3002\n<\/p>\n<p>\n\t\u4f46\u662f\u8d8a\u591a\u7684\u7ed3\u5408\u5c31\u610f\u5473\u7740\u529f\u80fd\u5b9e\u73b0\u8d8a\u590d\u6742\uff0c\u6211\u4eec\u9700\u8981\u5199\u5927\u91cf\u7684\u4ee3\u7801\u53bb\u5b9e\u73b0\u7c7b\u4f3c\u6570\u636e\u7ed1\u5b9a\u3001\u52a8\u6001\u5c55\u73b0\u3001\u8fdc\u7a0b\u670d\u52a1\u8bf7\u6c42\u7b49\u529f\u80fd\uff0c\u6240\u4ee5jQuery\u8fd9\u7c7b\u7684JS\u5e93\u3001ember\u8fd9\u7c7b\u7684\u6846\u67b6\u5e94\u7528\u800c\u751f\u3002\u524d\u8005\u8ba9\u6211\u4eec\u5728\u5b8c\u6210\u67d0\u4e9b\u5355\u4e00\u529f\u80fd\u65f6\u8c03\u7528\u5b83\u5c01\u88c5\u597d\u7684\u65b9\u6cd5\uff0c\u4ece\u800c\u51cf\u5c11\u4ee3\u7801\u91cf\u3002\u540e\u8005\u8ba9\u6211\u4eec\u53ef\u4ee5\u9075\u5faa\u5b83\u7684\u89c4\u8303\u53bb\u586b\u5145\u5b83\u8bbe\u8ba1\u597d\u7684\u4ee3\u7801\u7ed3\u6784\uff0c\u4ece\u800c\u9010\u6b65\u5b8c\u6210\u5b8c\u6574\u7684\u5e94\u7528\u529f\u80fd\u3002\n<\/p>\n<p>\n\t\u800cAngularJS\u662fJS\u5e93\u548c\u6846\u67b6\u7684\u7ed3\u5408\uff0c\u5b83\u8bde\u751f\u4e8e2009\u5e74\uff0c\u7531Misko Hevery \u7b49\u4eba\u521b\u5efa\uff0c\u540e\u4e3aGoogle\u6240\u6536\u8d2d\u5e76\u53d1\u626c\u5149\u5927\u3002AngularJS\u901a\u8fc7\u4e3a\u5f00\u53d1\u8005\u5448\u73b0\u4e00\u4e2a\u66f4\u9ad8\u5c42\u6b21\u7684\u62bd\u8c61\u6765\u7b80\u5316\u5e94\u7528\u7684\u5f00\u53d1\uff0c\u63d0\u4f9b\u4e86\u6784\u5efa\u4e00\u4e2aCRUD\u5e94\u7528\u53ef\u80fd\u7528\u5230\u7684\u5168\u90e8\u5185\u5bb9\u5305\u62ec\uff1a\u81ea\u5b9a\u4e49HTML\u6807\u7b7e\u3001\u4e8b\u4ef6\u7ed1\u5b9a\u3001\u6570\u636e\u7ed1\u5b9a\u3001\u57fa\u672c\u6a21\u677f\u6807\u8bc6\u7b26\u3001\u8868\u5355\u9a8c\u8bc1\u3001\u8def\u7531\u3001\u6df1\u5ea6\u94fe\u63a5\u3001\u7ec4\u4ef6\u91cd\u7528\u3001\u4f9d\u8d56\u6ce8\u5165\u7b49\u3002\n<\/p>\n<h2>\n\tAngularJS\u7684\u7279\u6027<br \/>\n<\/h2>\n<p>\n\tAngularJS\u6709\u7740\u8bf8\u591a\u7684\u7279\u6027\uff0c\u4f46\u6700\u4e3a\u6838\u5fc3\u7684\u662f\u5176Scope\u6982\u5ff5\u3001MVC\u6a21\u5f0f\u3001\u8def\u7531\u3001\u6a21\u5757\u5316\u3001\u4f9d\u8d56\u6ce8\u5165\u3001\u6307\u4ee4\u7cfb\u7edf\u3001\u53cc\u5411\u6570\u636e\u7ed1\u5b9a\u3001Service\u3001Provider\u7b49\u3002\n<\/p>\n<h2>\n\tAngularJS\u7684\u6a21\u5757\u5316<br \/>\n<\/h2>\n<p>\n\t\u6211\u4eec\u5148\u4eceAngularJS\u7684\u6a21\u5757\u5316\u7279\u6027\u8bf4\u8d77\u3002\u4ec0\u4e48\u662f\u6a21\u5757\uff1f\u65e2\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4e0d\u540c\u529f\u80fd\u7684\u5bb9\u5668\u3002\u5728AngularJS\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6309\u4e1a\u52a1\u529f\u80fd\u7684\u4e0d\u540c\u5c06\u5b9e\u73b0\u5212\u5206\u4e3a\u4e0d\u540c\u7684\u6a21\u5757\uff0c\u8fd9\u4e9b\u6a21\u5757\u53ef\u4ee5\u5728\u4e00\u4e2aJS\u6587\u4ef6\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5c06\u5b83\u4eec\u653e\u5728\u4e0d\u540c\u7684JS\u6587\u4ef6\u4e2d\uff0c\u65e2\u4e00\u4e2aJS\u6587\u4ef6\u4e3a\u4e00\u4e2a\u6a21\u5757\u3002\n<\/p>\n<h2>\n\tAngularJS\u6a21\u5757\u5316\u7684\u4f18\u52bf<br \/>\n<\/h2>\n<ol>\n<li>\n\t\t\u53ef\u4ee5\u4f7f\u6211\u4eec\u7684\u4ee3\u7801\u7ed3\u6784\u975e\u5e38\u6e05\u6670\uff0c\u6709\u8f83\u597d\u7684\u53ef\u8bfb\u6027\u3002\n\t<\/li>\n<li>\n\t\t\u53ef\u4ee5\u4f7f\u6211\u4eec\u590d\u7528\u4ee3\u7801\u3002\n\t<\/li>\n<li>\n\t\t\u5728\u524d\u7aef\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u90fd\u77e5\u9053JS\u7684\u5f15\u7528\u987a\u5e8f\u662f\u5f88\u91cd\u8981\u7684\uff0c\u4f46\u4f7f\u7528AngularJS\u7684\u6a21\u5757\u65f6\u6211\u4eec\u4e0d\u9700\u8981\u5173\u7cfb\u6bcf\u4e2a\u6a21\u5757\u4e4b\u95f4\u7684\u987a\u5e8f\u3002\n\t<\/li>\n<li>\n\t\t\u53ef\u4ee5\u5f88\u597d\u7684\u5b9e\u73b0\u5355\u5143\u6d4b\u8bd5\u3002\n\t<\/li>\n<\/ol>\n<h2>\n\tAngularJS\u5b9a\u4e49\u6a21\u5757<br \/>\n<\/h2>\n<p>\n\t\u5b9a\u4e49\u4e00\u4e2a\u6a21\u5757\u5f88\u7b80\u5355\uff0c\u5728JS\u6587\u4ef6\u4e2d\u7533\u660e\u4e00\u4e2a\u6a21\u5757\n<\/p>\n<pre class=\"brush:jscript;\">\r\nvar mianModule = angular.module(&quot;mianModule&quot;, []);<\/pre>\n<p>\n\t\u4f7f\u7528AngularJS\u7684module\u65b9\u6cd5\u7533\u660e\u4e00\u4e2a\u6a21\u5757\uff0c\u8be5\u65b9\u6cd5\u6709\u4e24\u4e2a\u53c2\u6570\uff1a\n<\/p>\n<ol>\n<li>\n\t\t\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3a\u6a21\u5757\u540d\u79f0\u3002\n\t<\/li>\n<li>\n\t\t\u7b2c\u4e8c\u4e2a\u53c2\u6570\u4e3a\u4e00\u4e2a\u6570\u7ec4\uff0c\u8be5\u53c2\u6570\u7684\u542b\u4e49\u4e3a\u5f53\u524d\u5b9a\u4e49\u7684\u6a21\u5757\u6240\u4f9d\u8d56\u7684\u6a21\u5757\uff0c\u5982\u679c\u6709\u4f9d\u8d56\u6a21\u5757\u5219\u4f20\u5165\u5305\u542b\u6a21\u5757\u540d\u79f0\u7684\u6570\u7ec4\uff0c\u82e5\u65e0\u4f9d\u8d56\u5219\u4f20\u5165\u7a7a\u6570\u7ec4\u3002\n\t<\/li>\n<\/ol>\n<h2>\n\t\u4f7f\u7528AngularJS\u7684\u6a21\u5757<br \/>\n<\/h2>\n<p>\n\t\u5728\u4e86\u89e3\u5982\u4f55\u4f7f\u7528\u5b9a\u4e49\u597d\u7684\u6a21\u5757\u4e4b\u524d\uff0c\u9700\u8981\u5148\u6e05\u695a\u5728AngularJS\u4e2d\uff0c\u6a21\u5757\u4e0e\u6a21\u5757\u4e4b\u95f4\u53ef\u4ee5\u662f\u76f8\u4e92\u72ec\u7acb\uff0c\u8001\u6b7b\u4e0d\u76f8\u5f80\u6765\u7684\u5173\u7cfb\uff0c\u4e5f\u53ef\u4ee5\u662f\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u4e14\u53ef\u4ee5\u662f\u5d4c\u5957\u4f9d\u8d56\u5173\u7cfb\uff1a\n<\/p>\n<pre class=\"brush:jscript;\">\r\n\/\/ modules.js\r\n\/\/ \u4e92\u76f8\u72ec\u7acb\u7684\u6a21\u5757\r\nvar mainModule = angular.module(&quot;mainModule&quot;, []);\r\nvar anotherModule = angular.module(&quot;anotherModule&quot;, []);\r\n\/\/ modules.js\r\n\/\/ \u6709\u4f9d\u8d56\u5173\u7cfb\u7684\u6a21\u5757\r\nvar mainModule = angular.module(&quot;mainModule&quot;, [\"secondModule\"]);\r\nvar secondModule = angular.module(&quot;secondModule&quot;, [\"thirdModule\"]);\r\nvar thirdModule = angular.module(&quot;thirdModule&quot;, []);<\/pre>\n<p>\n\t\u5728AngularJS\u4e2d\u4f7f\u7528\u5b9a\u4e49\u597d\u7684\u6a21\u5757\u4e5f\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u5bf9\u5e94\u4e24\u79cd\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u3002\n<\/p>\n<h2>\n\tngApp\u7684\u65b9\u5f0f<br \/>\n<\/h2>\n<p>\n\t\u8fd9\u79cd\u65b9\u5f0f\u662fAngularJS\u56e2\u961f\u6bd4\u8f83\u63a8\u8350\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u53ea\u9700\u8981\u5728HTML\u6807\u7b7e\u4e2d\u4f7f\u7528AngularJS\u7684ng-app\u6307\u4ee4\u6307\u5b9a\u8981\u4f7f\u7528\u7684\u6a21\u5757\u65e2\u53ef\uff0c\u4e00\u822c\u6307\u5b9a\u7684\u662f\u5e94\u7528\u7684\u4e3b\u6a21\u5757\uff0c\u6216\u8005\u8bf4\u662f\u5e94\u7528\u5165\u53e3\u6a21\u5757\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;!-- index.html --&gt;\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;meta charset=&quot;utf-8&quot;&gt;\r\n    &lt;title&gt;Demo for Module&lt;\/title&gt;\r\n    &lt;script src=&quot;..\/angular-1.5.8.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;modules.js&quot;&gt;&lt;\/script&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body ng-app=&quot;mainModule&quot;&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\n\tng-app\u6307\u4ee4\u7684\u542b\u4e49\u7c7b\u4f3cJava\u4e2d\u7684main\u65b9\u6cd5\uff0c\u662f\u5f53\u524d\u9875\u9762\u4e2d\u5e94\u7528\u7684\u552f\u4e00\u4e3b\u5165\u53e3\uff0c\u6240\u4ee5\u4e00\u4e2a\u9875\u9762\u4e2d\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21np-app\u6307\u4ee4\u3002\u5c06ng-app\u6307\u4ee4\u5b9a\u4e49\u5728\u54ea\u4e2aHTML\u7684\u6807\u7b7e\u4e2d\u5c31\u8868\u793a\u8be5\u6807\u7b7e\u53ca\u5b83\u7684\u6240\u6709\u5b50\u6807\u7b7e\u5c31\u4f1a\u88abAngularJS\u63a5\u7ba1\uff0c\u8fd9\u4e00\u90e8\u5206HTML\u4ee3\u7801\u5c06\u53ef\u4ee5\u4f7f\u7528AngularJS\u6240\u6709\u7684\u529f\u80fd\u548c\u7279\u6027\uff0c\u4e5f\u5c31\u662f\u4f7f\u7528AngularJS\u5f00\u53d1\u7684Web\u5e94\u7528\u7684\u4e3b\u5165\u53e3\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\u90fd\u4f1a\u5728body\u6807\u7b7e\u4e2d\u4f7f\u7528ng-app\u6307\u4ee4\u3002\n<\/p>\n<p>\n\t\u56e0\u4e3a\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\u53ea\u80fd\u6307\u5b9a\u4e00\u4e2a\u5e94\u7528\u5165\u53e3\u6a21\u5757\uff0c\u6240\u4ee5\u4e3a\u4e86\u80fd\u4f7f\u7528\u591a\u6a21\u5757\u7684\u7279\u6027\uff0c\u5c31\u9700\u8981\u62bd\u8c61\u51fa\u4e00\u4e2a\u4e3b\u6a21\u5757\uff0c\u7136\u540e\u5c06\u5176\u4ed6\u6240\u6709\u6a21\u5757\u52a0\u5165\u4e3b\u6a21\u5757\u7684\u4f9d\u8d56\u5173\u7cfb\u4e2d\uff0c\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f\u56e0\u4e3aAngularJS\u4e2d\u7684\u6a21\u5757\u4f9d\u8d56\u53ef\u4ee5\u5411\u4e0b\u7a7f\u900f\uff0c\u7c7b\u4f3c\u7c7b\u7684\u7ee7\u627f\uff0c\u6240\u4ee5\u52a0\u5165\u4e3b\u6a21\u5757\u4f9d\u8d56\u5173\u7cfb\u4e2d\u7684\u6a21\u5757\u5e76\u4e0d\u662f\u6240\u6709\u7684\u6a21\u5757\uff0c\u800c\u53ea\u662f\u5904\u4e8e\u4f9d\u8d56\u5c42\u7ea7\u9876\u5c42\u7684\u6a21\u5757\u3002<br \/>\n\t<img decoding=\"async\" alt=\"AngularJS\u7684\u4f9d\u8d56\u5c42\u7ea7\u5173\u7cfb\" src=\"http:\/\/7xpp8a.com1.z0.glb.clouddn.com\/angularjs\/angularjs-guide-1.png\" \/>\n<\/p>\n<p>\n\t\u5982\u4e0a\u56fe\u6240\u793a\uff0c\u5728\u4e3b\u6a21\u5757\u4e2d\u53ea\u9700\u8981\u6dfb\u52a0<strong>DataHandleModule<\/strong>\u548c<strong>NetworkModule<\/strong>\u4e24\u4e2a\u6a21\u5757\u65e2\u53ef\u3002\u4f46\u662f\u8fd9\u79cd\u65b9\u5f0f\u7684\u5f0a\u7aef\u662f\u5728HTML\u9875\u9762\u4e2d\u5e76\u4e0d\u80fd\u76f4\u89c2\u7684\u8868\u73b0\u51fa\u9875\u9762\u7684\u54ea\u4e9b\u90e8\u5206\u4f7f\u7528\u4e86\u4f55\u79cd\u6a21\u5757\uff0c\u800c\u4e14\u672c\u8eab\u63d0\u4f9b\u4e86\u6a21\u5757\u5316\u7684\u7279\u6027\uff0c\u4f46\u6700\u7ec8\u53c8\u8981\u62bd\u8c61\u5230\u4e00\u4e2a\u6a21\u5757\u4e2d\u53bb\u4f7f\u7528\uff0c\u59cb\u7ec8\u6709\u70b9\u4e0d\u662f\u5f88\u8212\u670d\u3002\n<\/p>\n<h2>\n\t\u624b\u52a8\u52a0\u8f7d\u65b9\u5f0f<br \/>\n<\/h2>\n<p>\n\t\u867d\u7136\u4f7f\u7528ng-app\u7684\u5f62\u5f0f\u53ef\u4ee5\u6ee1\u8db3\u9700\u6c42\uff0c\u4f46\u662f\u8fd8\u8981\u8003\u8651\u60f3\u62bd\u8c61\u51fa\u4e3b\u6a21\u5757\uff0c\u7136\u540e\u4f9d\u8d56\u4e00\u5927\u5806\u6a21\u5757\uff0c\u5982\u679c\u66f4\u5e0c\u671b\u53ef\u4ee5\u5728HTML\u6807\u7b7e\u4e2d\u6307\u5b9a\u4f7f\u7528\u7684\u6a21\u5757\uff0c\u6b64\u65f6\u5c31\u9700\u8981\u624b\u52a8\u7684\u52a0\u8f7d\u6a21\u5757\u4e86:\n<\/p>\n<pre class=\"brush:jscript;\">\r\n\/\/ modules.js\r\n\/\/ \u4e92\u76f8\u72ec\u7acb\u7684\u6a21\u5757\r\nvar mainModule = angular.module(&quot;mainModule&quot;, []);\r\nvar anotherModule = angular.module(&quot;anotherModule&quot;, []);\r\nangular.element(document).ready(function() {\r\n  var myDiv1 = document.getElementById(&quot;myDiv1&quot;);\r\n  angular.bootstrap(myDiv1, [\"mainModule\"]);\r\n  var myDiv2 = document.getElementById(&quot;myDiv2&quot;);\r\n  angular.bootstrap(myDiv2, [\"anotherModule\"]);\r\n});<\/pre>\n<pre class=\"brush:xml;\">\r\n&lt;!-- index.html --&gt;\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;meta charset=&quot;utf-8&quot;&gt;\r\n    &lt;title&gt;Demo for Module&lt;\/title&gt;\r\n    &lt;script src=&quot;..\/angular-1.5.8.js&quot;&gt;&lt;\/script&gt;\r\n    &lt;script src=&quot;modules.js&quot;&gt;&lt;\/script&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=&quot;\u4e1a\u4f59\u8349&quot;&gt;\r\n    &lt;\/div&gt;\r\n    &lt;div id=&quot;xttblog&quot;&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\n\t\u901a\u8fc7\u4e0a\u8ff0\u4ee3\u7801\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528AngularJS\u7684bootstrap\u65b9\u6cd5\u7ed9HTML\u5143\u7d20\u6307\u5b9a\u6a21\u5757\u3002\u8fd9\u6837\u611f\u89c9\u548c\u6a21\u5757\u5316\u7279\u6027\u66f4\u52a0\u5207\u5408\uff0c\u6a21\u5757\u7684\u9694\u79bb\u6027\u4e5f\u6bd4\u8f83\u597d\uff0c\u4f46\u662f\u8fd9\u79cd\u65b9\u5f0f\u4f9d\u7136\u6709\u663e\u8457\u7684\u5f0a\u7aef\u3002\u9996\u5148\u4eceHTML\u9875\u9762\u4e2d\u4f9d\u7136\u4e0d\u80fd\u76f4\u89c2\u7684\u770b\u5230\u6a21\u5757\u5728\u9875\u9762\u4e2d\u4f7f\u7528\u548c\u5206\u5e03\u60c5\u51b5\uff0c\u518d\u6b21\u8fd9\u79cd\u65b9\u5f0f\u5c06\u89c6\u56fe\u5c42\u7684HTML\u4ee3\u7801\u4e0eJS\u4ee3\u7801\u8026\u5408\u5728\u4e86\u4e00\u8d77\uff0c\u4e5f\u6709\u70b9\u8fdd\u80cc\u4e86AngularJS\u7684MVC\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u4e5f\u8bb8\u8fd9\u4e5f\u662fAngularJS\u4e0d\u63a8\u8350\u8be5\u65b9\u5f0f\u7684\u539f\u56e0\u4e4b\u4e00\u5427\u3002\n<\/p>\n<p>\n\t<strong>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u672a\u7ecf\u535a\u4e3b\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/strong><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=848\">AngularJS\u5165\u95e8\u6559\u7a0b(\u4e00)\u7279\u6027\u548c\u6a21\u5757<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>AngularJS 2.0\u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u638c\u63e1AngularJS 1.x\u7684\u57fa\u672c\u77e5\u8bc6\u80fd\u66f4\u5feb\u7684\u5e2e\u52a9\u6211\u4eec\u8fc8\u5165Angula [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[518,119,519,48],"class_list":["post-848","post","type-post","status-publish","format-standard","hentry","category-html5","tag-angularjs","tag-html5","tag-ng-app","tag-web"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=848"}],"version-history":[{"count":3,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/848\/revisions"}],"predecessor-version":[{"id":866,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/848\/revisions\/866"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}