{"id":428,"date":"2017-02-18T16:14:17","date_gmt":"2017-02-18T08:14:17","guid":{"rendered":"http:\/\/www.qdabc.cn\/?p=428"},"modified":"2017-02-18T16:14:17","modified_gmt":"2017-02-18T08:14:17","slug":"angularjs-%e8%87%aa%e5%ae%9a%e4%b9%89%e5%b8%b8%e9%87%8f%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"http:\/\/www.qdabc.cn\/?p=428","title":{"rendered":"AngularJS \u81ea\u5b9a\u4e49\u5e38\u91cf\u670d\u52a1"},"content":{"rendered":"<pre class=\"brush:html;toolbar:false\">&lt;!DOCTYPE html&gt;  \r\n&lt;html ng-app=\"App\"&gt;  \r\n&lt;head&gt;  \r\n    &lt;meta charset=\"UTF-8\"&gt;  \r\n    &lt;title&gt;AngularJS \u81ea\u5b9a\u4e49\u5e38\u91cf\u670d\u52a1&lt;\/title&gt;  \r\n&lt;\/head&gt;  \r\n&lt;body&gt;  \r\n    &lt;div ng-controller=\"DemoController\"&gt;  \r\n        {{author}}  \r\n        {{version}}  \r\n    &lt;\/div&gt;  \r\n    &lt;script src=\".\/libs\/angular.min.js\"&gt;&lt;\/script&gt;  \r\n    &lt;script&gt;  \r\n        var App = angular.module('App', []);  \r\n  \r\n        \/\/ \u81ea\u5b9a\u4e49\u5e38\u91cf\u670d\u52a1  \r\n  \r\n        \/\/ \u63d0\u4f9b\u4e863\u79cd\u65b9\u6cd5\u5b9e\u73b0\u81ea\u5b9a\u4e49\u670d\u52a1  \r\n        \/\/ factory\u3001service\u3001value  \r\n  \r\n        App.value('author', 'geng');  \r\n        App.value('version', '1.0');  \r\n  \r\n        \/\/ \u672c\u8d28\u4e0a\u4e00\u4e2a\u670d\u52a1  \r\n        \/\/ \u4ece\u8868\u73b0\u5f62\u5f0f\u4e0a\u662f\u4e00\u4e2a\u5e38\u91cf  \r\n        \/\/ \u5e38\u91cf\u5c31\u662f\u4e0d\u53d8\u7684\u503c\u4e0e\u53d8\u5bf9\u91cf\u76f8\u5bf9\u5e94  \r\n  \r\n        \/\/ \u58f0\u660e\u4f9d\u8d56\u8c03\u7528\u670d\u52a1  \r\n        App.controller('DemoController', ['$scope', 'author', 'version', function ($scope, author, version) {  \r\n            $scope.author = author;  \r\n            $scope.version =version;  \r\n  \r\n        }])  \r\n  \r\n    &lt;\/script&gt;  \r\n&lt;\/body&gt;  \r\n&lt;\/html&gt;<\/pre>\n<p class=\"post-copyright\">\u6b22\u8fce\u5206\u4eab\u672c\u6587\uff0c\u8f6c\u8f7d\u8bf7\u4fdd\u7559\u51fa\u5904\uff1a<a href=\"http:\/\/www.qdabc.cn\">\u524d\u7aefABC<\/a> &raquo; <a href=\"http:\/\/www.qdabc.cn\/?p=428\">AngularJS \u81ea\u5b9a\u4e49\u5e38\u91cf\u670d\u52a1<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html ng-app=&#8221;App&#8221;&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243;&gt; &lt;title&#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":317,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[53,98],"_links":{"self":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/428"}],"collection":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=428"}],"version-history":[{"count":1,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions"}],"predecessor-version":[{"id":429,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions\/429"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=\/wp\/v2\/media\/317"}],"wp:attachment":[{"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.qdabc.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}