//解决安装后新建出现的bug npm uninstall -g ionic npm uninstall -g corodva npm install -g ionic cordova
ionic plugin add cordova-plugin-crosswalk-webview
ionic run android
@NgModule({ declarations: [ MyApp, TabsPage, LoginPage ], imports: [ IonicModule.forRoot(MyApp, { backButtonIcon: ‘arrow-back‘, iconMode: ‘ios‘, pageTransition: ‘ios‘, tabbarPlacement: ‘bottom‘, backButtonText: ‘返回‘ }, {} )], bootstrap: [IonicApp], entryComponents: [ LoginPage, MyApp, TabsPage ], providers: [UserService,AppConfigService,{provide: ErrorHandler, useClass: IonicErrorHandler}] })
<button ion-button (click)="loginFn()" color="danger" block default > 立即登录 </button>
@Component({ templateUrl: ‘login.html‘, selector: ‘login-page‘, })
"scripts": { "release": "ionic-app-scripts build --prod", //调用angular2提供的AOT,加快浏览器客户端编译,不过文件也许变大,可以使用服务器zigb压缩 }
//找到 node_modules//@ionic/app-scripts/dist/dev-server/http-server.js文件 //搜索proxyMiddleware,用http-proxy-middleware替换proxy-middleware var proxyMiddleware = require(‘http-proxy-middleware‘); //搜索proxy.proxyNoAgent,替换下面的语句 47 //if (proxy.proxyNoAgent) { 48 // opts.agent = false; 49 //} 50 //opts.rejectUnauthorized = !(proxy.rejectUnauthorized === false); 51 app.use(proxy.path, proxyMiddleware({ 52 target: proxy.proxyUrl, 53 changeOrigin: true 54 })); 55 //app.use(proxy.path, proxyMiddleware(opts));
@mixin addAppImage($imagePath) { background-image: url("../images/" + $imagePath); }
原文:http://www.cnblogs.com/qingkong/p/6500933.html