angularjs4+ionic3集成搭建
1:安装一下cnpm用淘宝镜像安装
npm install -g cnpm --registry=https://registry.npm.taobao.org
2:使用 cnpm命令安装(全局安装 Angular CLI 脚手架工具)
cnpm install -g @angular/cli
3:ng new 项目名称 创建一个项目
ng new my-app
4:进入刚才创建的项目里面启动服务
cd my-app cnpm install //安装依赖 ng serve
5:运行
ng serve --open
6:项目导入
7:创建组建
cd 项目
ng g component components\login
8:属性 定义 赋值,*ngFor *ngIf 与 [hidden]
[hidden] 可以解决 同数组 引入多模板异常
9:数据双向绑定
需要引入组件
在app.module.ts中增加
import { FormsModule } from '@angular/forms';
imports: [
BrowserModule,
FormsModule
],
事件 [(ngModel)]="属性"
10:公共组件 放到 单独的服务中
11: 创建服务
ng g service service\storage
storage.service.ts
localStorage.setItem(key,JSON.stringify(v))
JSON.stringify(localStorage.getItem(key))
在app.module.ts中 引入 注入
import { StorageService} from 'storage.service.ts文件件目录(去掉后缀)';
providers:[StorageService]
其他组件引入
import { StorageService} from 'storage.service.ts文件件目录(去掉后缀)';
构造函数 声明注入
constructor(private storage:StorageService){
this.storage.setItem("","");
}
二
安装 Ionic
cnpm install -g cordova ionic
ionic -v
ionic start hyd-mobile blank/tabs
ionic serve
5创建 ionic组件
cd hyd-mobile
ionic g component 组件名
第一次创建模块 会生成一个模块管理文件,后期不会生成只会自动追加 引入...
6复制,list展示
7.ionic 组件 根目录引入新建的模块,注册模块
新建的模块需要用 abgularjs的语法需要引入abgularjs相关组件(BrowserModule)
8.创建一个页面
ionic g page 页面名
新建的页面需要在app\app.module.ts 引入、生明
9.页面跳转 路由
10.新增tabs,子页面隐藏tabs,在app\app.module.ts设置
11. ionic开发——Node Sass does not yet support your current environment解决办法
npm uninstall --save node-sass
npm install --save node-sass
@ionic\app-scripts
npm install ion-multi-picker@2.1.0 --save
12.打包
http://blog.csdn.net/liujiawei00/article/details/74356356
https://www.cnblogs.com/jiangtengteng/p/6680654.html
ionic cordova platform add android
ionic cordova build android/ ionic build android --prod
build android -release
(node:17392) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Built the following apk(s):
E:\hy_workspace\hyd-mobile\platforms\android\app\build\outputs\apk\debug\app-debug.apk
【技巧】ionic3优雅解决启动前、后黑白屏问题
https://www.jianshu.com/p/87efc5e396c3
ionic cordova build android --prod
https://www.jianshu.com/p/102bd23625cb
极光推送
https://www.jianshu.com/p/eb8ab29329d9
ionic2实战-签名android App/android打包
https://www.jianshu.com/p/8b2a9c3a1c07
ionic2实战-扫描二维码下载app,同时支持android和ios
https://www.jianshu.com/p/a589335e861e
ionic2实战-封装插件进行精确定位和导航
https://www.jianshu.com/p/85aceaee3b35
语法校验的坑
https://www.cnblogs.com/eedc/p/7833550.html
ionic2实战-添加拍照功能cordova-plugin-camera
https://www.jianshu.com/p/29247301a611
切换淘宝源:
设置:npm config set registry https://registry.npm.taobao.org
查看:npm config get registry
angularjs4+ionic3集成搭建的更多相关文章
- Spring+SpringMvc+Mybatis框架集成搭建教程
一.背景 最近有很多同学由于没有过SSM(Spring+SpringMvc+Mybatis , 以下简称SSM)框架的搭建的经历,所以在自己搭建SSM框架集成的时候,出现了这样或者那样的问题,很是苦恼 ...
- Spring+SpringMVC+Mybatis(SSM)框架集成搭建
Spring+SpringMVC+Mybatis框架集成搭建教程 一.背景 最近有很多同学由于没有过SSM(Spring+SpringMvc+Mybatis , 以下简称SSM)框架的搭建的经历,所以 ...
- SpringBoot+Mybatis集成搭建
本博客介绍一下SpringBoot集成Mybatis,数据库连接池使用alibaba的druid,使用SpringBoot微框架虽然集成Mybatis之后可以不使用xml的方式来写sql,但是用惯了x ...
- Ionic3环境搭建及创建
初次尝试Ionic,边学习边记录下来,以免以后忘记了,入坑向( ̄ω ̄;) 1.Ionic环境安装 Ionic开发是依赖于Nodejs环境的,所以在开发之前我们需要安装好Nodejs.下载安装:http ...
- 通过springBoot集成搭建webScoket服务器
前言: 最近工作中有一个需求,就是服务端要主动推送消息给客户端,而我们平常的Http请求只能一请求一响应,为此学习了webScokset通讯技术,以下介绍的是java 通过SpringBoot集成we ...
- Spring+SpringMvc+Mybatis框架集成搭建教程一(项目创建)
一.框架搭建环境 Spring 4.2.6.RELEASE SpringMvc 4.2.6.RELEASE Mybatis 3.2.8 Maven 3.3.9 Jdk 1.7 Idea 15.04 二 ...
- Spring+SpringMvc+Mybatis框架集成搭建教程四(项目部署及测试)
在IDEA中将项目部署到本地Tomcat下进行运行并验证整合结果 (1).点击如下图所示的下拉按钮,弹出Edit Configurations...后点击该项. (2).跳出如下界面后,点击红框内的& ...
- AngularJS4.0环境搭建详解--windows系统环境
第一步:安装NodeJS 下载最新版的NodeJS并安装,安装完成后打开CMD命令行,输入以下命令: node -v 若返回类似版本号则代表NodeJS安装成功,如下: 第二部 安装npm 新版的No ...
- windows环境下简单Jenkins持续集成搭建
Jenkins是基于Java开发的持续集成工具,所以在安装Jenkins之前我们要确定电脑上已经安装了Java JDK并且环境变量配置正确,否则在启动使用java -jar Jenkins.war启动 ...
随机推荐
- nodejs websocket
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script> <script ty ...
- (转)Spring Boot 2 (二):Spring Boot 2 尝鲜-动态 Banner
http://www.ityouknow.com/springboot/2018/03/03/spring-boot-banner.html Spring Boot 2.0 提供了很多新特性,其中就有 ...
- C# SHA256加密算法记录
using System.Text; using System.Diagnostics; using System.Security; using System.Security.Cryptograp ...
- WinForm下的loading框的实现
前言:在项目使用C/S模式情况下,由于需要经常进行数据的刷新,如果直接进行刷新,会有一个等待控件重画的过程,非常的不友好,因此在这里添加一个loading框进行等待显示. 实现:在经过多方面查询资料, ...
- java读取properties中文乱码
1 确认properties文件的编码是utf-8 2 采用流的方式读取文件,设置编码为utf-8 public class ErrorCodeConfig { static Properties p ...
- 转发 .Net平台下ActiveMQ入门实例 https://www.cnblogs.com/madyina/p/4121458.html
1.ActiveMQ简介 先分析这么一个场景:当我们在网站上购物时,必须经过,下订单.发票创建.付款处理.订单履行.航运等.但是,当用户下单后,立即跳转到“感谢那您的订单” 页面.不仅如此,若果没有延 ...
- Ubuntu16.04环境安装jenkins
前提:系统必须安装jdk 如果没有安装可通过如下命令安装: sudo add-apt-repository ppa:openjdk-r/ppa sudo apt update sudo apt ins ...
- jmeter(二十二)内存溢出原因及解决方法
jmeter是一个java开发的开源性能测试工具,在性能测试中可支持模拟并发压测,但有时候当模拟并发请求较大或者脚本运行时间较长时,压力机会出现卡顿甚至报异常————内存溢出, 这里就介绍下如何解决内 ...
- 使用Windows Live Writer撰写的第一篇博文
一直没有时间,在自己的电脑上配置起来Windows Live Writer. 今天抽时间搞起来后,感觉果然比在Web版写作不知道爽多少倍哦. 还安装了代码插件,上传代码和图片也方便了很多,霸气. 先上 ...
- [HNOI2019]多边形[二叉树建模、组合计数]
题意 题目链接 分析 不难发现终态一定是 \([2,n-2]\) 中的每个点都与 \(n\) 连边. 关于凸多边形的划分问题,可以将它看作一棵二叉树:每个树点可以看做点可以看做边. 本题中看做点来处理 ...