安装angular
1.nodejs
2.npm
3.typescript
4.angular
项目初始化
1. mkdir test 2. mkdir src 3. npm -y init 4.src/hello.js 5.npm install --save-dev jshint 6. .jshintrc { "browser": true, "browserify": true, "devel": true } 7.package.json "scripts": { "lint": "jshint src" } 8.npm run lint 单元测试 1. npm install --save-dev jasmine-core sinon Jasmine: 单元测试框架 Sinon: 测试库 2. npm install --save-dev karma karma-jasmine karma-jshint-preprocessor Karma: test runner 3. npm install --save-dev phantomjs karma-phantomjs-launcher Phantom: 浏览器运行环境 4. karma.conf.js module.exports = function(config) { config.set({ frameworks: ['jasmine'], files: [ 'src/**/*.js', 'test/**/*_spec.js' ], preprocessors: { 'test/**/*.js': ['jshint'], 'src/**/*.js': ['jshint'] }, browsers: ['PhantomJS'] }) } 5. .jshintrc { "browser": true, "browserify": true, "devel": true, "globals": { "jasmine": false, "describe": false, "it": false, "expect": false, "beforeEach": false, "afterEach": false } } 6. package.json "scripts": { "lint": "jshint src test", "test": "karma start" } 7. npm run lint npm run test
项目模块化
1. browserify && refer plugins
npm install --save-dev browserify karma-browserify
Lodash && jQuery
作者:smileJiuer
链接:https://www.jianshu.com/p/88412851a596
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦