{"id":985,"date":"2015-09-26T10:18:25","date_gmt":"2015-09-26T02:18:25","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=985"},"modified":"2015-09-26T10:18:34","modified_gmt":"2015-09-26T02:18:34","slug":"ionic-%e5%9f%ba%e6%9c%ac%e8%b0%83%e7%94%a8","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=985","title":{"rendered":"ionic \u57fa\u672c\u8c03\u7528"},"content":{"rendered":"<h3 id=\"ionic\u7b80\u4ecb\">ionic\u7b80\u4ecb<\/h3>\n<p>ionic\u662f\u4e00\u4e2a\u4e13\u6ce8\u4e8e\u7528WEB\u5f00\u53d1\u6280\u672f\uff0c\u57fa\u4e8eHTML5\u521b\u5efa\u7c7b\u4f3c\u4e8e\u624b\u673a\u5e73\u53f0\u539f\u751f\u5e94\u7528\u7684\u4e00\u4e2a\u5f00\u53d1\u6846\u67b6\u3002\u76ee\u524d\u7ed1\u5b9a\u7684\u4e0eangularJS\u548cSASS\u3002\u8fd9\u4e2a\u6846\u67b6\u7684\u76ee\u7684\u662f\u4eceweb\u7684\u89d2\u5ea6\u5f00\u53d1\u624b\u673a\u5e94\u7528\uff0c\u57fa\u4e8ePhoneGap\u7684\u7f16\u8bd1\u5e73\u53f0\uff0c\u53ef\u4ee5\u5b9e\u73b0\u7f16\u8bd1\u6210\u5404\u4e2a\u5e73\u53f0\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h3 id=\"ionic\u5b89\u88c5\">ionic\u5b89\u88c5<\/h3>\n<p>\u9996\u5148\u9700\u8981\u5b89\u88c5cordova\u548candroid\u73af\u5883\u3002\u8fd9\u4e2a\u53c2\u8003\u6211\u7684\u53e6\u4e00\u7bc7\u6587\u7ae0\uff1a<a href=\"http:\/\/www.haomou.net\/2014\/08\/06\/2014_phonegap_android\/\" target=\"_blank\" rel=\"external\">phoneGap\u4e4bAndroid\u73af\u5883\u642d\u5efa<\/a>\uff0c\u4e0a\u9762\u5199\u7684\u5f88\u8be6\u7ec6\uff0c\u8fd8\u6709\u5e38\u89c1\u7684\u9519\u8bef\u53ca\u89e3\u51b3\u529e\u6cd5\u3002<br \/>\n\u7136\u540e\u5b89\u88c5ionic:<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">npm install -g ionic<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528ionic\u521b\u5efa\u9879\u76ee\u4e86\u3002<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ionic start myApp tabs   \/\/\u521b\u5efa\u5e26\u6709top\u680f\u548cbottom\u680f\u7684\u793a\u4f8b\u9879\u76ee\r\nionic start myApp sidemenu  \/\/\u521b\u5efa\u5e26\u6709\u5de6\u4fa7\u5e26\u6709menu\u680f\u7684\u793a\u4f8b\u9879\u76ee\r\nionic start myApp blank   \/\/\u521b\u5efa\u7a7a\u767d\u9879\u76ee<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5177\u4f53\u6548\u679c\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u7f51\uff1a <a href=\"http:\/\/ionicframework.com\/getting-started\/\" target=\"_blank\" rel=\"external\">http:\/\/ionicframework.com\/getting-started\/<\/a><br \/>\n\u7136\u540e\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ionic serve<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u8be5\u547d\u4ee4\u4f1a\u81ea\u52a8\u542f\u52a8\u6d41\u6d4f\u89c8\u5668\uff0c\u67e5\u770b\u5f53\u524d\u6548\u679c\u3002<\/p>\n<h3 id=\"\u6dfb\u52a0Android\u5e73\u53f0\">\u6dfb\u52a0Android\u5e73\u53f0<\/h3>\n<p>\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4,<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">cd myApp\r\nionic platform add android \/\/\u8fd9\u884c\u53ef\u80fd\u4f1a\u62a5\u9519\r\nionic build android\r\nionic emulate android<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5176\u5b9e\u4e0a\u9762\u7684\u4f7f\u7528\u65b9\u6cd5\u548ccordova\u5dee\u4e0d\u591a\uff0c\u6dfb\u52a0android\u7684\u65f6\u5019\u53ef\u80fd\u4f1a\u62a5\u9519\uff0c\u5982\u4e0b\uff1a<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">The error is:\r\n=======================================\r\nevents.js:72\r\nthrow er; \/\/ Unhandled 'error' event\r\n^\r\nError: spawn ENOENT\r\nat errnoException (child_process.js:1000:11)\r\nat Process.ChildProcess._handle.onexit (child_process.js:791:34)<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u89e3\u51b3\u7684\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u5c06ionic\u6362\u6210cordova\u5373\u53ef\uff0c\u7ecf\u6d4b\u8bd5works fine\u3002<\/p>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">cd myApp\r\ncordova platform add android \/\/\u8fd9\u884c\u53ef\u80fd\u4f1a\u62a5\u9519\r\ncordova build android\r\ncordova emulate android<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"\u5176\u4ed6\u5e38\u89c1\u9519\u8bef\">\u5176\u4ed6\u5e38\u89c1\u9519\u8bef<\/h3>\n<ol>\n<li>\u751f\u6210\u9879\u76ee(ionic start myApp tabs)\u65f6\u53ef\u80fd\u4f1a\u62a5\u9519\uff0c\u5982\u4e0b\uff1a<br \/>\n<figure class=\"highlight\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">Error: command failed:fatal:could not create work tree dir:'C:\\Users\/ADMINI~1\\AppData\\Local\\Temp\\plugman\\git\\1402853493773'.:No such file or directory<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<\/li>\n<\/ol>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a\u8fdb\u5165\u4e0a\u9762\u5bf9\u5e94\u7684\u76ee\u5f55\uff0c\u5efa\u7acb\u5bf9\u5e94\u7684\u6587\u4ef6\u3002\u6bd4\u5982\u5728temp\u76ee\u5f55\u4e0b\u5efa\u7acbplugman\u76ee\u5f55\uff0c\u5728plugman\u76ee\u5f55\u4e0b\u5efa\u7acbgit\u76ee\u5f55\uff0c\u7136\u540e\u518dgit\u4e0b\u5efa\u7acb1402853493773\u76ee\u5f55\u3002\u5373\u53ef\uff0c\u7ecf\u6d4b\u8bd5\u6709\u6548\u3002<\/p>\n<h3 id=\"css\u7ec4\u4ef6\">css\u7ec4\u4ef6<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>ionic\u7b80\u4ecb ionic\u662f\u4e00\u4e2a\u4e13\u6ce8\u4e8e\u7528WEB\u5f00\u53d1\u6280\u672f\uff0c\u57fa\u4e8eHTML5\u521b\u5efa\u7c7b\u4f3c\u4e8e\u624b\u673a\u5e73\u53f0\u539f\u751f\u5e94\u7528\u7684\u4e00\u4e2a\u5f00\u53d1\u6846\u67b6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71],"tags":[],"class_list":["post-985","post","type-post","status-publish","format-standard","hentry","category-phone"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=985"}],"version-history":[{"count":2,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/985\/revisions"}],"predecessor-version":[{"id":987,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/985\/revisions\/987"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=985"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}