{"id":3032,"date":"2018-08-09T08:33:06","date_gmt":"2018-08-09T00:33:06","guid":{"rendered":"http:\/\/www.daliane.com\/?p=3032"},"modified":"2018-08-09T08:33:06","modified_gmt":"2018-08-09T00:33:06","slug":"angular_chang_jian_mian_shi_ti","status":"publish","type":"post","link":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/angular_chang_jian_mian_shi_ti\/","title":{"rendered":"Angular\u5e38\u89c1\u9762\u8bd5\u9898"},"content":{"rendered":"<h2 style=\"font-size:24px;color:#4F4F4F;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">1.angular\u7684\u6570\u636e\u7ed1\u5b9a\u91c7\u7528\u4ec0\u4e48\u673a\u5236\uff1f\u8be6\u8ff0\u539f\u7406<\/span><br \/>\n<\/h2>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">\u810f\u68c0\u67e5\u673a\u5236\u3002<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">\u53cc\u5411\u6570\u636e\u7ed1\u5b9a\u662f AngularJS \u7684\u6838\u5fc3\u673a\u5236\u4e4b\u4e00\u3002\u5f53 view \u4e2d\u6709\u4efb\u4f55\u6570\u636e\u53d8\u5316\u65f6\uff0c\u4f1a\u66f4\u65b0\u5230 model \uff0c\u5f53 model \u4e2d\u6570\u636e\u6709\u53d8\u5316\u65f6\uff0cview \u4e5f\u4f1a\u540c\u6b65\u66f4\u65b0\uff0c\u663e\u7136\uff0c\u8fd9\u9700\u8981\u4e00\u4e2a\u76d1\u63a7\u3002<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">\u539f\u7406\u5c31\u662f\uff0c<\/span><span style=\"color:#0000FF;\">Angular \u5728 scope \u6a21\u578b\u4e0a\u8bbe\u7f6e\u4e86\u4e00\u4e2a<\/span><span style=\"color:#FF0000;\">\u76d1\u542c\u961f\u5217<\/span><span style=\"color:#0000FF;\">\uff0c\u7528\u6765\u76d1\u542c\u6570\u636e\u53d8\u5316\u5e76\u66f4\u65b0 view \u3002\u6bcf\u6b21\u7ed1\u5b9a\u4e00\u4e2a\u4e1c\u897f\u5230 view \u4e0a\u65f6 AngularJS \u5c31\u4f1a\u5f80 $watch \u961f\u5217\u91cc\u63d2\u5165\u4e00\u6761 $watch \uff0c\u7528\u6765\u68c0\u6d4b\u5b83\u76d1\u89c6\u7684 model \u91cc\u662f\u5426\u6709\u53d8\u5316\u7684\u4e1c\u897f\u3002\u5f53\u6d4f\u89c8\u5668\u63a5\u6536\u5230\u53ef\u4ee5\u88ab angular context \u5904\u7406\u7684\u4e8b\u4ef6\u65f6\uff0c $digest \u5faa\u73af\u5c31\u4f1a\u89e6\u53d1\uff0c\u904d\u5386\u6240\u6709\u7684 $watch \uff0c\u6700\u540e\u66f4\u65b0 dom\u3002<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\"><br \/>\n<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\"><span style=\"color:#333333;\">2<\/span><span style=\"color:#333333;\">&nbsp;<a name=\"OLE_LINK2\"><\/a><\/span>AngularJS\u7684\u6570\u636e\u53cc\u5411\u7ed1\u5b9a\u662f\u600e\u4e48\u5b9e\u73b0\u7684\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t1\u3001\u6bcf\u4e2a\u53cc\u5411\u7ed1\u5b9a\u7684\u5143\u7d20\u90fd\u6709\u4e00\u4e2awatcher\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t2\u3001\u5728\u67d0\u4e9b\u4e8b\u4ef6\u53d1\u751f\u7684\u65f6\u5019\uff0c\u8c03\u7528digest\u810f\u6570\u636e\u68c0\u6d4b\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8fd9\u4e9b\u4e8b\u4ef6\u6709\uff1a\u8868\u5355\u5143\u7d20\u5185\u5bb9\u53d8\u5316\u3001Ajax\u8bf7\u6c42\u54cd\u5e94\u3001\u70b9\u51fb\u6309\u94ae\u6267\u884c\u7684\u51fd\u6570\u7b49\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t3\u3001\u810f\u6570\u636e\u68c0\u6d4b\u4f1a\u68c0\u6d4brootscope\u4e0b\u6240\u6709\u88abwatcher\u7684\u5143\u7d20\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$digest\u51fd\u6570\u5c31\u662f\u810f\u6570\u636e\u76d1\u6d4b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">3.\u5728\u4f7f\u7528angularjs\u9879\u76ee\u5f00\u53d1\u4e2d \u4f60\u4f7f\u7528\u8fc7\u90a3\u4e9b\u7b2c\u4e09\u65b9\u7684\u63d2\u4ef6<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tAngularUi &nbsp;ui-router oclazyload\u7b49\u7b49 &nbsp;\u9644\u4e0a\u4e00\u7bc7\u6587\u7ae0\u4ed4\u7ec6\u53bb\u770b\u770b&nbsp;<span style=\"color:#000000;\">https:\/\/segmentfault.com\/a\/1190000003858219<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">4.ng-show\/ng-hide&nbsp;\u4e0e&nbsp;ng-if\u7684\u533a\u522b\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6211\u4eec\u90fd\u77e5\u9053ng-show\/ng-hide\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7display\u6765\u8fdb\u884c\u9690\u85cf\u548c\u663e\u793a\u7684\u3002\u800cng-if\u5b9e\u9645\u4e0a\u63a7\u5236dom\u8282\u70b9\u7684\u589e\u5220\u9664\u6765\u5b9e\u73b0\u7684\u3002\u56e0\u6b64\u5982\u679c\u6211\u4eec\u662f\u6839\u636e\u4e0d\u540c\u7684\u6761\u4ef6\u6765\u8fdb\u884cdom\u8282\u70b9\u7684\u52a0\u8f7d\u7684\u8bdd\uff0c\u90a3\u4e48ng-if\u7684\u6027\u80fd\u597d\u8fc7ng-show<span style=\"color:#333333;\">.<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">5 \u89e3\u91ca\u4e0b\u4ec0\u4e48\u662f$rootScrope\u4ee5\u53ca\u548c$scope\u7684\u533a\u522b\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u901a\u4fd7\u7684\u8bf4$rootScrope&nbsp;\u9875\u9762\u6240\u6709$scope\u7684\u7236\u4eb2\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6211\u4eec\u6765\u770b\u4e0b\u5982\u4f55\u4ea7\u751f$rootScope\u548c$scope\u5427\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tstep1:Angular\u89e3\u6790ng-app\u7136\u540e\u5728\u5185\u5b58\u4e2d\u521b\u5efa$rootScope\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tstep2:angular\u56de\u7ee7\u7eed\u89e3\u6790\uff0c\u627e\u5230{{}}\u8868\u8fbe\u5f0f\uff0c\u5e76\u89e3\u6790\u6210\u53d8\u91cf\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tstep3:\u63a5\u7740\u4f1a\u89e3\u6790\u5e26\u6709ng-controller\u7684div\u7136\u540e\u6307\u5411\u5230\u67d0\u4e2acontroller\u51fd\u6570\u3002 \u8fd9\u4e2a\u65f6\u5019\u5728\u8fd9\u4e2acontroller\u51fd\u6570\u53d8\u6210\u4e00\u4e2a$scope\u5bf9\u8c61\u5b9e\u4f8b\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<h3 style=\"font-size:22px;color:#4F4F4F;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<a name=\"t2\"><\/a>6 \u5217\u51fa\u81f3\u5c11\u4e09\u79cd\u5b9e\u73b0\u4e0d\u540c\u6a21\u5757\u4e4b\u95f4\u901a\u4fe1\u65b9\u5f0f\uff1f<br \/>\n<\/h3>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tService\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;events,\u6307\u5b9a\u7ed1\u5b9a\u7684\u4e8b\u4ef6\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f7f\u7528 $rootScope\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tcontroller\u4e4b\u95f4\u76f4\u63a5\u4f7f\u7528$parent,&nbsp;$$childHead\u7b49\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;directive \u6307\u5b9a\u5c5e\u6027\u8fdb\u884c\u6570\u636e\u7ed1\u5b9a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">7. \u8868\u8fbe\u5f0f {{yourModel}} \u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u5b83\u4f9d\u8d56\u4e8e $interpolation\u670d\u52a1\uff0c\u5728\u521d\u59cb\u5316\u9875\u9762html\u540e\uff0c\u5b83\u4f1a\u627e\u5230\u8fd9\u4e9b\u8868\u8fbe\u5f0f\uff0c\u5e76\u4e14\u8fdb\u884c\u6807\u8bb0\uff0c\u4e8e\u662f\u6bcf\u9047\u89c1\u4e00\u4e2a {{}} \uff0c\u5219\u4f1a\u8bbe\u7f6e\u4e00\u4e2a $watch \u3002\u800c $interpolation \u4f1a\u8fd4\u56de\u4e00\u4e2a\u5e26\u6709\u4e0a\u4e0b\u6587\u53c2\u6570\u7684\u51fd\u6570\uff0c\u6700\u540e\u8be5\u51fd\u6570\u6267\u884c\uff0c\u5219\u7b97\u662f\u8868\u8fbe\u5f0f $parse \u5230\u90a3\u4e2a\u4f5c\u7528\u57df\u4e0a\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#333333;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">8.angular\u4e2d\u7684$http<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$http \u662f AngularJS \u4e2d\u7684\u4e00\u4e2a\u6838\u5fc3\u670d\u52a1\uff0c\u7528\u4e8e\u8bfb\u53d6\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u6570\u636e\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684$http\u670d\u52a1\u76f4\u63a5\u540c\u5916\u90e8\u8fdb\u884c\u901a\u4fe1\u3002$http\u670d\u52a1\u53ea\u662f\u7b80\u5355\u7684\u5c01\u88c5\u4e86\u6d4f\u89c8\u5668\u539f\u751f\u7684XMLHttpRequest\u5bf9\u8c61\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">9.ng-repeat\u8fed\u4ee3\u6570\u7ec4\u7684\u65f6\u5019\uff0c\u5982\u679c\u6570\u7ec4\u4e2d\u6709\u76f8\u540c\u503c\uff0c\u4f1a\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u5982\u4f55\u89e3\u51b3\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f1a\u63d0\u793a Duplicates in a repeater are not allowed. \u52a0 track by $index \u53ef\u89e3\u51b3\u3002\u5f53\u7136\uff0c\u4e5f\u53ef\u4ee5 trace by \u4efb\u4f55\u4e00\u4e2a\u666e\u901a\u7684\u503c\uff0c\u53ea\u8981\u80fd\u552f\u4e00\u6027\u6807\u8bc6\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u9879\u5373\u53ef\uff08\u5efa\u7acb dom \u548c\u6570\u636e\u4e4b\u95f4\u7684\u5173\u8054\uff09\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">10.angularjs \u662fmvc\u8fd8\u662fmvvm\u6846\u67b6<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#FF0000;\">\u9996\u5148\u9610\u8ff0\u4e0b\u4f60\u5bf9mvc\u548cmvvm\u7684\u7406\u89e3<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u9996\u5148\u4e3a\u4ec0\u4e48\u6211\u4eec\u4f1a\u9700\u8981MVC\uff1f\u56e0\u4e3a\u968f\u7740\u4ee3\u7801\u89c4\u6a21\u8d8a\u6765\u8d8a\u5927\uff0c\u5207\u5206\u804c\u8d23\u662f\u5927\u52bf\u6240\u8d8b\uff0c\u8fd8\u6709\u4e3a\u4e86\u540e\u671f\u7ef4\u62a4\u65b9\u4fbf\uff0c\u4fee\u6539\u4e00\u5757\u529f\u80fd\u4e0d\u5f71\u54cd\u5176\u4ed6\u529f\u80fd\u3002\u8fd8\u6709\u4e3a\u4e86\u590d\u7528\uff0c\u56e0\u4e3a\u5f88\u591a\u903b\u8f91\u662f\u4e00\u6837\u7684\u3002\u800cMVC\u53ea\u662f\u624b\u6bb5\uff0c\u7ec8\u6781\u76ee\u6807\u662f\u6a21\u5757\u5316\u548c\u590d\u7528\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#FF0000;\">mvvm<\/span><span style=\"color:#FF0000;\">\u7684\u4f18\u70b9<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f4e\u8026\u5408\uff1aView\u53ef\u4ee5\u72ec\u7acb\u4e8eModel\u53d8\u5316\u548c\u4fee\u6539\uff0c\u540c\u4e00\u4e2aViewModel\u53ef\u4ee5\u88ab\u591a\u4e2aView\u590d\u7528\uff1b\u5e76\u4e14\u53ef\u4ee5\u505a\u5230View\u548cModel\u7684\u53d8\u5316\u4e92\u4e0d\u5f71\u54cd\uff1b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53ef\u91cd\u7528\u6027\uff1a\u53ef\u4ee5\u628a\u4e00\u4e9b\u89c6\u56fe\u7684\u903b\u8f91\u653e\u5728ViewModel\uff0c\u8ba9\u591a\u4e2aView\u590d\u7528\uff1b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u72ec\u7acb\u5f00\u53d1\uff1a\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4e13\u6ce8\u4e0e\u4e1a\u52a1\u903b\u8f91\u548c\u6570\u636e\u7684\u5f00\u53d1\uff08ViewModemvvmdi\u8ba1\u4eba\u5458\u53ef\u4ee5\u4e13\u6ce8\u4e8eUI(View)\u7684\u8bbe\u8ba1\uff1b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53ef\u6d4b\u8bd5\u6027\uff1a\u6e05\u6670\u7684View\u5206\u5c42\uff0c\u4f7f\u5f97\u9488\u5bf9\u8868\u73b0\u5c42\u4e1a\u52a1\u903b\u8f91\u7684\u6d4b\u8bd5\u66f4\u5bb9\u6613\uff0c\u66f4\u7b80\u5355\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u5728angular\u4e2dMVVM\u6a21\u5f0f\u4e3b\u8981\u5206\u4e3a\u56db\u90e8\u5206\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tView\uff1a\u5b83\u4e13\u6ce8\u4e8e\u754c\u9762\u7684\u663e\u793a\u548c\u6e32\u67d3\uff0c\u5728angular\u4e2d\u5219\u662f\u5305\u542b\u4e00\u5806\u58f0\u660e\u5f0fDirective\u7684\u89c6\u56fe\u6a21\u677f\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tViewModel\uff1a\u5b83\u662fView\u548cModel\u7684\u7c98\u5408\u4f53\uff0c\u8d1f\u8d23View\u548cModel\u7684\u4ea4\u4e92\u548c\u534f\u4f5c\uff0c\u5b83\u8d1f\u8d23\u7ed9View\u63d0\u4f9b\u663e\u793a\u7684\u6570\u636e\uff0c\u4ee5\u53ca\u63d0\u4f9b\u4e86View\u4e2dCommand\u4e8b\u4ef6\u64cd\u4f5cModel\u7684\u9014\u5f84\uff1b\u5728angular\u4e2d$scope\u5bf9\u8c61\u5145\u5f53\u4e86\u8fd9\u4e2aViewModel\u7684\u89d2\u8272\uff1b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tModel\uff1a\u5b83\u662f\u4e0e\u5e94\u7528\u7a0b\u5e8f\u7684\u4e1a\u52a1\u903b\u8f91\u76f8\u5173\u7684\u6570\u636e\u7684\u5c01\u88c5\u8f7d\u4f53\uff0c\u5b83\u662f\u4e1a\u52a1\u9886\u57df\u7684\u5bf9\u8c61\uff0cModel\u5e76\u4e0d\u5173\u5fc3\u4f1a\u88ab\u5982\u4f55\u663e\u793a\u6216\u64cd\u4f5c\uff0c\u6240\u4ee5\u6a21\u578b\u4e5f\u4e0d\u4f1a\u5305\u542b\u4efb\u4f55\u754c\u9762\u663e\u793a\u76f8\u5173\u7684\u903b\u8f91\u3002\u5728web\u9875\u9762\u4e2d\uff0c\u5927\u90e8\u5206Model\u90fd\u662f\u6765\u81eaAjax\u7684\u670d\u52a1\u7aef\u8fd4\u56de\u6570\u636e\u6216\u8005\u662f\u5168\u5c40\u7684\u914d\u7f6e\u5bf9\u8c61\uff1b\u800cangular\u4e2d\u7684service\u5219\u662f\u5c01\u88c5\u548c\u5904\u7406\u8fd9\u4e9b\u4e0eModel\u76f8\u5173\u7684\u4e1a\u52a1\u903b\u8f91\u7684\u573a\u6240\uff0c\u8fd9\u7c7b\u7684\u4e1a\u52a1\u670d\u52a1\u662f\u53ef\u4ee5\u88ab\u591a\u4e2aController\u6216\u8005\u5176\u4ed6service\u590d\u7528\u7684\u9886\u57df\u670d\u52a1\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tController\uff1a\u8fd9\u5e76\u4e0d\u662fMVVM\u6a21\u5f0f\u7684\u6838\u5fc3\u5143\u7d20\uff0c\u4f46\u5b83\u8d1f\u8d23ViewModel\u5bf9\u8c61\u7684\u521d\u59cb\u5316\uff0c\u5b83\u5c06\u7ec4\u5408\u4e00\u4e2a\u6216\u8005\u591a\u4e2aservice\u6765\u83b7\u53d6\u4e1a\u52a1\u9886\u57dfModel\u653e\u5728ViewModel\u5bf9\u8c61\u4e0a\uff0c\u4f7f\u5f97\u5e94\u7528\u754c\u9762\u5728\u542f\u52a8\u52a0\u8f7d\u7684\u65f6\u5019\u8fbe\u5230\u4e00\u79cd\u53ef\u7528\u7684\u72b6\u6001\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tmvc\u7684\u754c\u9762\u548c\u903b\u8f91\u5173\u8054\u7d27\u5bc6\uff0c\u6570\u636e\u76f4\u63a5\u4ece\u6570\u636e\u5e93\u8bfb\u53d6\u3002mvvm\u7684\u754c\u9762\u4e0eviewmode\u662f\u677e\u8026\u5408\uff0c\u754c\u9762\u6570\u636e\u4eceviewmodel\u4e2d\u83b7\u53d6\u3002\u6240\u4ee5angularjs\u66f4\u503e\u5411\u4e8emvvm\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">11.angularjs\u4e2d$scope\uff0ccontroller\uff0cdirective\uff0csevice\u5728mvvm\u4e2d\u5145\u5f53\u4ec0\u4e48\u89d2\u8272<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u5982\u679c\u4f60\u4e0d\u77e5\u9053\uff0c\u7b2c\u4e00\u9898\u7684\u5206\u6790\u4ee5\u53ca\u5f88\u660e\u786e\uff0c\u4ed4\u7ec6\u518d\u4ed4\u7ec6\u7684\u770b\u4e00\u904d\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">12.\u5728\u4f7f\u7528angularjs\u9879\u76ee\u5f00\u53d1\u4e2d \u4f60\u4f7f\u7528\u8fc7\u90a3\u4e9b\u7b2c\u4e09\u65b9\u7684\u63d2\u4ef6<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tAngularUi &nbsp;ui-router oclazyload\u7b49\u7b49&nbsp;&nbsp;\u9644\u4e0a\u4e00\u7bc7\u6587\u7ae0\u4ed4\u7ec6\u53bb\u770b\u770b&nbsp;<u>https:\/\/segmentfault.com\/a\/1190000003858219<\/u>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">13.\u5728angular\u9879\u76ee\u4e2d\u4f60\u5982\u4f55\u63a7\u5236\u9759\u6001\u8d44\u6e90\u7684\u5408\u7406\u52a0\u8f7d<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;\u61d2\u52a0\u8f7d\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u7b2c\u4e09\u9898\u63d0\u5230\u4e86oclazyload\u8fd9\u4e2a\u63d2\u4ef6\uff0c\u5f88\u597d\u7684\u4e00\u4e2a\u61d2\u52a0\u8f7d\u9759\u6001\u8d44\u6e90\u7684\u7b2c\u4e09\u65b9\u63d2\u4ef6\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">14.\u518d\u5199controlloer\u903b\u8f91\u7684\u65f6\u5019 \u4f60\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t1.\u7b80\u5316\u4ee3\u7801\uff08\u8fd9\u4e2a\u662f\u6240\u6709\u5f00\u53d1\u4eba\u5458\u90fd\u8981\u5177\u5907\u7684\uff09\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t2.\u575a\u51b3\u4e0d\u80fd\u64cd\u4f5cdom\u8282\u70b9 \u8fd9\u4e2a\u65f6\u5019\u53ef\u80fd\u4f1a\u95ee \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u554a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f60\u7684\u56de\u7b54\u662f\uff1aDOM\u64cd\u4f5c\u53ea\u80fd\u51fa\u73b0\u5728\u6307\u4ee4\uff08directive\uff09\u4e2d\u3002\u6700\u4e0d\u5e94\u8be5\u51fa\u73b0\u7684\u4f4d\u7f6e\u5c31\u662f\u670d\u52a1\uff08service\uff09\u4e2d\u3002Angular\u5021\u5bfc\u4ee5<span style=\"color:#CE222B;\">\u6d4b\u8bd5\u9a71\u52a8<\/span>\u5f00\u53d1\uff0c\u5728service\u6216\u8005controller\u4e2d\u51fa\u73b0\u4e86DOM\u64cd\u4f5c\uff0c\u90a3\u4e48\u4e5f\u5c31\u610f\u5473\u7740\u7684\u6d4b\u8bd5\u662f\u65e0\u6cd5\u901a\u8fc7\u7684\u3002\u5f53\u7136\uff0c\u8fd9\u53ea\u662f\u4e00\u70b9\uff0c\u91cd\u8981\u7684\u662f\u4f7f\u7528Angular\u7684\u5176\u4e2d\u4e00\u4e2a\u597d\u5904\u662f\u5565\uff0c\u90a3\u5c31\u662f\u53cc\u5411\u6570\u636e\u7ed1\u5b9a\uff0c\u8fd9\u6837\u5c31\u80fd\u4e13\u6ce8\u4e8e\u5904\u7406\u4e1a\u52a1\u903b\u8f91\uff0c\u65e0\u9700\u5173\u7cfb\u4e00\u5806\u5806\u7684DOM\u64cd\u4f5c\u3002\u5982\u679c\u5728Angular\u7684\u4ee3\u7801\u4e2d\u8fd8\u5230\u5904\u5145\u65a5\u7740\u5404\u79cdDOM\u64cd\u4f5c\uff0c\u90a3\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u4f7f\u7528jquery\u53bb\u5f00\u53d1\u5462\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1\u662f\u4ec0\u4e48\u5462\uff1f\u666e\u53ca\u4e00\u4e0b\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1\uff0c\u82f1\u6587\u5168\u79f0Test-Driven Development\uff0c\u7b80\u79f0TDD\uff0c\u662f\u4e00\u79cd\u4e0d\u540c\u4e8e\u4f20\u7edf\u8f6f\u4ef6\u5f00\u53d1\u6d41\u7a0b\u7684\u65b0\u578b\u7684\u5f00\u53d1\u65b9\u6cd5\u3002\u5b83\u8981\u6c42\u5728\u7f16\u5199\u67d0\u4e2a\u529f\u80fd\u7684\u4ee3\u7801\u4e4b\u524d\u5148\u7f16\u5199\u6d4b\u8bd5\u4ee3\u7801\uff0c\u7136\u540e\u53ea\u7f16\u5199\u4f7f\u6d4b\u8bd5\u901a\u8fc7\u7684\u529f\u80fd\u4ee3\u7801\uff0c\u901a\u8fc7\u6d4b\u8bd5\u6765\u63a8\u52a8\u6574\u4e2a\u5f00\u53d1\u7684\u8fdb\u884c\u3002\u8fd9\u6709\u52a9\u4e8e\u7f16\u5199\u7b80\u6d01\u53ef\u7528\u548c\u9ad8\u8d28\u91cf\u7684\u4ee3\u7801\uff0c\u5e76\u52a0\u901f\u5f00\u53d1\u8fc7\u7a0b\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">15.AngularJS\u7684\u6570\u636e\u53cc\u5411\u7ed1\u5b9a\u662f\u600e\u4e48\u5b9e\u73b0\u7684\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t1\u3001\u6bcf\u4e2a\u53cc\u5411\u7ed1\u5b9a\u7684\u5143\u7d20\u90fd\u6709\u4e00\u4e2awatcher\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t2\u3001\u5728\u67d0\u4e9b\u4e8b\u4ef6\u53d1\u751f\u7684\u65f6\u5019\uff0c\u8c03\u7528digest\u810f\u6570\u636e\u68c0\u6d4b\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8fd9\u4e9b\u4e8b\u4ef6\u6709\uff1a\u8868\u5355\u5143\u7d20\u5185\u5bb9\u53d8\u5316\u3001Ajax\u8bf7\u6c42\u54cd\u5e94\u3001\u70b9\u51fb\u6309\u94ae\u6267\u884c\u7684\u51fd\u6570\u7b49\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t3\u3001\u810f\u6570\u636e\u68c0\u6d4b\u4f1a\u68c0\u6d4brootscope\u4e0b\u6240\u6709\u88abwatcher\u7684\u5143\u7d20\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$digest\u51fd\u6570\u5c31\u662f\u810f\u6570\u636e\u76d1\u6d4b\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53c8\u9644\u4e0a\u4e00\u7bc7\u539f\u7406\u6027\u7684\u6587\u7ae0&nbsp;https:\/\/github.com\/xufei\/Make-Your-Own-AngularJS\/blob\/master\/01.md\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">16.controller\u4e4b\u95f4\u600e\u4e48\u901a\u8baf<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t1\u3001event\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8fd9\u91cc\u53ef\u4ee5\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f$scope.$emit\uff0c\u7136\u540e\u901a\u8fc7\u76d1\u542c$rootScope\u7684\u4e8b\u4ef6\u83b7\u53d6\u53c2\u6570\uff1b\u53e6\u4e00\u79cd\u662f$rootScope.$broadcast\uff0c\u901a\u8fc7\u76d1\u542c$scope\u7684\u4e8b\u4ef6\u83b7\u53d6\u53c2\u6570\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8fd9\u4e24\u79cd\u65b9\u6cd5\u5728\u6700\u65b0\u7248\u672c\u7684Angular\u4e2d\u5df2\u7ecf\u6ca1\u6709\u6027\u80fd\u533a\u522b\u4e86\uff0c\u4e3b\u8981\u5c31\u662f\u4e8b\u4ef6\u53d1\u9001\u7684\u65b9\u5411\u4e0d\u540c\uff0c\u53ef\u4ee5\u6309\u5b9e\u9645\u60c5\u51b5\u9009\u62e9\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t2\u3001service\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u4e13\u7528\u7684\u4e8b\u4ef6Service\uff0c\u4e5f\u53ef\u4ee5\u6309\u7167\u4e1a\u52a1\u903b\u8f91\u5207\u5206\uff0c\u5c06\u6570\u636e\u5b58\u50a8\u5728\u76f8\u5e94\u7684Service\u4e2d\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t3\u3001$rootScope\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u80fd\u4f1a\u6bd4\u8f83dirty\u4e00\u70b9\uff0c\u80dc\u5728\u65b9\u4fbf\uff0c\u4e5f\u5c31\u662f\u628a\u6570\u636e\u5b58\u5728$rootScope\u4e2d\uff0c\u8fd9\u6837\u5404\u4e2a\u5b50$scope\u90fd\u53ef\u4ee5\u8c03\u7528\uff0c\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u4e00\u4e0b\u751f\u547d\u5468\u671f\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t4\u3001\u76f4\u63a5\u4f7f\u7528$scope.$$nextSibling\u53ca\u7c7b\u4f3c\u7684\u5c5e\u6027\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u7c7b\u4f3c\u7684\u8fd8\u6709$scope.$parent\u3002\u8fd9\u4e2a\u65b9\u6cd5\u7684\u7f3a\u70b9\u5c31\u66f4\u591a\u4e86\uff0c\u5b98\u65b9\u4e0d\u63a8\u8350\u4f7f\u7528\u4efb\u4f55$$\u5f00\u5934\u7684\u5c5e\u6027\uff0c\u65e2\u589e\u52a0\u4e86\u8026\u5408\uff0c\u53c8\u9700\u8981\u5904\u7406\u5f02\u6b65\u7684\u95ee\u9898\uff0c\u800c\u4e14scope\u7684\u987a\u5e8f\u4e5f\u4e0d\u662f\u56fa\u5b9a\u7684\u3002\u4e0d\u63a8\u8350\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53e6\u5916\u5c31\u662f\u901a\u8fc7\u672c\u5730\u5b58\u50a8\u3001\u5168\u5c40\u53d8\u91cf\u6216\u8005\u73b0\u4ee3\u6d4f\u89c8\u5668\u7684postMessage\u6765\u4f20\u9012\u53c2\u6570\u4e86\uff0c\u9664\u975e\u7279\u6b8a\u60c5\u51b5\uff0c\u8bf7\u907f\u514d\u8fd9\u7c7b\u65b9\u5f0f\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">17.\u81ea\u5b9a\u4e49\u6307\u4ee4\u7684\u51e0\u4e2a\u53c2\u6570<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u8bf4\u51e0\u4e2a\u5e38\u7528\u7684\u5982\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\trestrict:\u6307\u4ee4\u5728dom\u4e2d\u7684\u58f0\u660e\u5f62\u5f0f E\uff08\u5143\u7d20\uff09A\uff08\u5c5e\u6027\uff09C\uff08\u7c7b\u540d\uff09M\uff08\u6ce8\u91ca\uff09\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\ttemplate\uff1a\u4e24\u79cd\u5f62\u5f0f\uff0c\u4e00\u79cdHTML\u6587\u672c\uff1b\u4e00\u4e2a\u53ef\u4ee5\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\u7684\u51fd\u6570\uff0ctElemetn\u548ctAttrs\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u4ee3\u8868\u6a21\u677f\u7684\u5b57\u7b26\u4e32\u3002\u6a21\u677f\u5b57\u7b26\u4e32\u5fc5\u987b\u5b58\u5728\u4e00\u4e2a\u6839DOM\u5143\u7d20\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\ttemplateUrl:\u4e24\u79cd\u5f62\u5f0f\uff0c\u4e00\u79cd\u4ee3\u8868\u5916\u90e8HTML\u6587\u4ef6\u8def\u5f84\u7684\u5b57\u7b26\u4e32\uff1b\u4e00\u4e2a\u53ef\u4ee5\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\u7684\u51fd\u6570\uff0c\u53c2\u6570\u4e3atElement\u548ctAttrs\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u5916\u90e8HTML\u6587\u4ef6\u8def\u5f84\u7684\u5b57\u7b26\u4e32\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tcompile (\u5bf9\u8c61\u6216\u51fd\u6570)\uff1acompile \u9009\u9879\u53ef\u4ee5\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\u6216\u51fd\u6570\u3002\u5982\u679c\u8bbe\u7f6e\u4e86 compile \u51fd\u6570,\u8bf4\u660e\u6211\u4eec\u5e0c\u671b\u5728\u6307\u4ee4\u548c\u5b9e\u65f6\u6570\u636e\u88ab\u653e\u5230DOM\u4e2d\u4e4b\u524d\u8fdb\u884cDOM\u64cd\u4f5c,\u5728\u8fd9\u4e2a\u51fd\u6570\u4e2d\u8fdb\u884c\u8bf8\u5982\u6dfb\u52a0\u548c\u5220\u9664\u8282\u70b9\u7b49DOM\u64cd\u4f5c\u662f\u5b89\u5168\u7684\u3002\u672c\u8d28\u4e0a,\u5f53\u6211\u4eec\u8bbe\u7f6e\u4e86 link \u9009\u9879,\u5b9e\u9645\u4e0a\u662f\u521b\u5efa\u4e86\u4e00\u4e2a postLink() \u94fe\u63a5\u51fd\u6570,\u4ee5\u4fbf compile() \u51fd\u6570\u53ef\u4ee5\u5b9a\u4e49\u94fe\u63a5\u51fd\u6570\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u7136\u540e\u53c8\u662f\u4f20\u9001\u95e8\uff1a<u>http:\/\/www.cnblogs.com\/mliudong\/p\/4180680.html<\/u>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;compile\u548clink\u7684\u533a\u522b\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u7f16\u8bd1\u7684\u65f6\u5019\uff0ccompile\u8f6c\u6362dom\uff0c\u78b0\u5230\u7ed1\u5b9a\u76d1\u542c\u5668\u7684\u5730\u65b9\u5c31\u5148\u5b58\u7740\uff0c\u6709\u51e0\u4e2a\u5b58\u51e0\u4e2a\uff0c\u5230\u6700\u540e\u6c47\u603b\u6210\u4e00\u4e2alink\u51fd\u6570\uff0c\u4e00\u5e76\u6267\u884c\uff0c\u63d0\u5347\u4e86\u6027\u80fd\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">18.angular\u4e2d\u7684$http<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$http \u662f AngularJS \u4e2d\u7684\u4e00\u4e2a\u6838\u5fc3\u670d\u52a1\uff0c\u7528\u4e8e\u8bfb\u53d6\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u6570\u636e\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684$http\u670d\u52a1\u76f4\u63a5\u540c\u5916\u90e8\u8fdb\u884c\u901a\u4fe1\u3002$http\u670d\u52a1\u53ea\u662f\u7b80\u5355\u7684\u5c01\u88c5\u4e86\u6d4f\u89c8\u5668\u539f\u751f\u7684XMLHttpRequest\u5bf9\u8c61\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t1\u3001\u94fe\u5f0f\u8c03\u7528\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$http\u670d\u52a1\u662f\u53ea\u80fd\u63a5\u53d7\u4e00\u4e2a\u53c2\u6570\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5305\u542b\u4e86\u7528\u6765\u751f\u6210HTTP\u8bf7\u6c42\u7684\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u914d\u7f6e\u5185\u5bb9\u3002\u8fd9\u4e2a\u51fd\u6570\u8fd4\u56de\u4e00\u4e2apromise\u5bf9\u8c61\uff0c\u5177\u6709success\u548cerror\u4e24\u4e2a\u65b9\u6cd5\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t2\u3001\u8fd4\u56de\u4e00\u4e2apromise\u5bf9\u8c61\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t3\u3001\u5feb\u6377\u7684get\u8bf7\u6c42\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t4\u3001\u54cd\u5e94\u5bf9\u8c61\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f20\u9001\u95e8\uff1a<u>http:\/\/www.2cto.com\/kf\/201506\/405137.html<\/u>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">19.angular\u548cjquery\u7684\u533a\u522b<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tangular\u662f\u57fa\u4e8e\u6570\u636e\u9a71\u52a8\uff0c\u6240\u4ee5angular\u9002\u5408\u505a\u6570\u636e\u64cd\u4f5c\u6bd4\u8f83\u7e41\u7410\u7684\u9879\u76ee\uff08\u8fd9\u91cc\u53ef\u4ee5\u518d\u63d0\u4e00\u4e0b\u5355\u9875\u9762\u5e94\u7528\uff0c\u5982\u679c\u4f60\u4e0d\u4f1a\u798f\u5229\u53c8\u6765\u4e86&nbsp;http:\/\/www.zhihu.com\/question\/20792064\uff09\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tjquery\u662f\u57fa\u4e8edom\u9a71\u52a8\uff0cjquery\u9002\u5408\u505adom\u64cd\u4f5c\u591a\u7684\u9879\u76ee\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">20.\u5bf9angular\u4e2d\u7684form\u8868\u5355\u4e86\u89e3\u591a\u5c11<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tAngular\u5bf9input\u5143\u7d20\u7684type\u8fdb\u884c\u4e86\u6269\u5c55\uff0c\u4e00\u5171\u63d0\u4f9b\u4e86\u4ee5\u4e0b10\u79cd\u7c7b\u578b\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\ttext\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tnumber\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\turl\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\temail\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tradio\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tcheckbox\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\thidden\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tbutton\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tsubmit\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\treset\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tAngular\u4e3a\u8868\u5355\u5185\u7f6e\u4e864\u4e2dCSS\u6837\u5f0f\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-valid \u6821\u9a8c\u5408\u6cd5\u72b6\u6001\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-invalid \u6821\u9a8c\u975e\u6cd5\u72b6\u6001\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-pristine \u5982\u679c\u8981\u4f7f\u7528\u539f\u751f\u7684form\uff0c\u9700\u8981\u8bbe\u7f6e\u8fd9\u4e2a\u503c\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-dirty &nbsp;&nbsp;&nbsp;&nbsp;\u8868\u5355\u5904\u4e8e\u810f\u6570\u636e\u72b6\u6001\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tAngular\u5728\u5bf9\u8868\u5355\u8fdb\u884c\u81ea\u52a8\u6821\u9a8c\u7684\u65f6\u5019\u4f1a\u6821\u9a8cModel\u4e0a\u7684\u5c5e\u6027\uff0c\u5982\u679c\u4e0d\u8bbe\u7f6eng-model\uff0c\u5219Angular\u65e0\u6cd5\u77e5\u9053myForm.$invalid\u8fd9\u4e2a\u503c\u662f\u5426\u4e3a\u771f\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6821\u9a8c\u7684\u4e00\u4e0b\u5185\u5bb9\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\trequired \u8868\u793a\u662f\u5426\u8f93\u5165\u5185\u5bb9\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-maxlength \u6700\u5927\u957f\u5ea6\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng-minlength \u6700\u5c0f\u957f\u5ea6\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4f8b\u5b50\uff1a\u4f20\u9001\u95e8<u>https:\/\/github.com\/18500047564\/clutter<\/u>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">21. ng-show\/ng-hide \u4e0e ng-if \u7684\u533a\u522b\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u6211\u4eec\u90fd\u77e5\u9053ng-show\/ng-hide\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7 display \u6765\u8fdb\u884c\u9690\u85cf\u548c\u663e\u793a\u7684\u3002\u800cng-if\u5b9e\u9645\u4e0a\u63a7\u5236dom\u8282\u70b9\u7684\u589e\u5220\u9664\u6765\u5b9e\u73b0\u7684\u3002\u56e0\u6b64\u5982\u679c\u6211\u4eec\u662f\u6839\u636e\u4e0d\u540c\u7684\u6761\u4ef6\u6765\u8fdb\u884cdom\u8282\u70b9\u7684\u52a0\u8f7d\u786e\u8ba4\u7684\u8bdd\uff0c\u90a3\u4e48ng-if\u7684\u6027\u80fd\u597d\u8fc7ng-show.\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">22.\u89e3\u91ca\u4e0b\u4ec0\u4e48\u662f $rootScrope \u4ee5\u53ca\u548c $scope \u7684\u533a\u522b\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$rootScrope\u662f\u6240\u6709$scope\u7684\u7236\u5bf9\u8c61\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">23. \u8868\u8fbe\u5f0f {{yourModel}} \u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u5b83\u4f9d\u8d56\u4e8e $interpolation\u670d\u52a1\uff0c\u5728\u521d\u59cb\u5316\u9875\u9762html\u540e\uff0c\u5b83\u4f1a\u627e\u5230\u8fd9\u4e9b\u8868\u8fbe\u5f0f\uff0c\u5e76\u4e14\u8fdb\u884c\u6807\u8bb0\uff0c\u4e8e\u662f\u6bcf\u9047\u89c1\u4e00\u4e2a {{}} \uff0c\u5219\u4f1a\u8bbe\u7f6e\u4e00\u4e2a $watch \u3002\u800c $interpolation \u4f1a\u8fd4\u56de\u4e00\u4e2a\u5e26\u6709\u4e0a\u4e0b\u6587\u53c2\u6570\u7684\u51fd\u6570\uff0c\u6700\u540e\u8be5\u51fd\u6570\u6267\u884c\uff0c\u5219\u7b97\u662f\u8868\u8fbe\u5f0f $parse \u5230\u90a3\u4e2a\u4f5c\u7528\u57df\u4e0a\u3002\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"font-weight:700;\">24.fliter\u662f\u4ec0\u4e48\u4f60\u4e86\u89e3\u7684\u6709\u591a\u5c11\uff1f\u5b9e\u73b0\u4e00\u4e2a\u81ea\u5b9a\u4e49fliter<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tng \u5185\u7f6e\u7684 filter \u6709\u4e5d\u79cd\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">date\uff08\u65e5\u671f\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">currency\uff08\u8d27\u5e01\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">limitTo\uff08\u9650\u5236\u6570\u7ec4\u6216\u5b57\u7b26\u4e32\u957f\u5ea6\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">orderBy\uff08\u6392\u5e8f\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">lowercase\uff08\u5c0f\u5199\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">uppercase\uff08\u5927\u5199\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">number\uff08\u683c\u5f0f\u5316\u6570\u5b57\uff0c\u52a0\u4e0a\u5343\u4f4d\u5206\u9694\u7b26\uff0c\u5e76\u63a5\u6536\u53c2\u6570\u9650\u5b9a\u5c0f\u6570\u70b9\u4f4d\u6570\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">filter\uff08\u5904\u7406\u4e00\u4e2a\u6570\u7ec4\uff0c\u8fc7\u6ee4\u51fa\u542b\u6709\u67d0\u4e2a\u5b50\u4e32\u7684\u5143\u7d20\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">&nbsp;<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t<span style=\"color:#0000FF;\">json\uff08\u683c\u5f0f\u5316 json \u5bf9\u8c61\uff09<\/span>\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tfilter \u6709\u4e24\u79cd\u4f7f\u7528\u65b9\u6cd5\uff0c\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u4e00\u79cd\u662f\u76f4\u63a5\u5728\u9875\u9762\u91cc\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&lt;p&gt;{{now | date : \u2018yyyy-MM-dd\u2019}}&lt;\/p&gt;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u53e6\u4e00\u79cd\u662f\u5728 js \u91cc\u9762\u7528\uff1a\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$filter(&#8216;\u8fc7\u6ee4\u5668\u540d\u79f0&#8217;)(\u9700\u8981\u8fc7\u6ee4\u7684\u5bf9\u8c61, \u53c2\u65701, \u53c2\u65702,&#8230;)\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t$filter(&#8216;date&#8217;)(now, &#8216;yyyy-MM-dd hh:mm:ss\u2019);\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t\u81ea\u5b9a\u4e49\u4e00\u4e2a\u53bb\u91cd\u6570\u7ec4\u7684\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\tapp.filter(&#8216;unique&#8217;, function(){\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;return function(arr){\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var n = [];\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var obj = {};\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(var i = 0;i&lt;arr.length;i++){\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!obj[arr[i]]){\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n.push(arr[i])\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj[arr[i]] = 1;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return n;\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;&nbsp;&nbsp;&nbsp;}\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t})\n<\/p>\n<p style=\"font-size:16px;color:#4F4F4F;text-align:justify;font-family:-apple-system, &quot;background-color:#FFFFFF;\">\n\t&nbsp;\n<\/p>\n<p><a href=\"http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture-300x168.jpg\" alt=\"Capture\" width=\"300\" height=\"168\" class=\"alignnone size-medium wp-image-3033\" srcset=\"http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture-300x168.jpg 300w, http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture-1024x576.jpg 1024w, http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture-360x200.jpg 360w, http:\/\/www.daliane.com\/wp-content\/uploads\/2018\/08\/Capture.jpg 1115w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.angular\u7684\u6570\u636e\u7ed1\u5b9a\u91c7\u7528\u4ec0\u4e48\u673a\u5236\uff1f\u8be6\u8ff0\u539f\u7406 \u810f\u68c0\u67e5\u673a\u5236\u3002 \u53cc\u5411\u6570\u636e\u7ed1\u5b9a\u662f AngularJS \u7684\u6838\u5fc3\u673a&#8230;<\/p>\n","protected":false},"author":2,"featured_media":3033,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[38],"tags":[65],"_links":{"self":[{"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/posts\/3032"}],"collection":[{"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/comments?post=3032"}],"version-history":[{"count":1,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/posts\/3032\/revisions"}],"predecessor-version":[{"id":3034,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/posts\/3032\/revisions\/3034"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/media\/3033"}],"wp:attachment":[{"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/media?parent=3032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/categories?post=3032"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.daliane.com\/category\/jinjiaoyou\/wp-json\/wp\/v2\/tags?post=3032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}