Coder Social home page Coder Social logo

pinkyjie / angular1-webpack-starter Goto Github PK

View Code? Open in Web Editor NEW
141.0 8.0 39.0 4.45 MB

Component based Angular(1.x) web development with Webpack and ES6.

License: MIT License

JavaScript 86.70% Shell 0.56% CSS 5.43% HTML 7.31%
angular webpack es6 material-design travis sauce-labs e2e-tests unit-test

angular1-webpack-starter's People

Contributors

pinkyjie avatar yperevoznikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular1-webpack-starter's Issues

Lazy load

  • Support lazy load for each page.
  • Extract 3rd packages to external files.
  • Make webpack config ready for production.

Travis CI support

  • Automatically run all the tests.
  • Build the project and push to gh-pages branch.
  • Also push the test coverage HTML report to gh-pages branch.
  • Add badges.

$stateProvider problem

请教一个问题:
看到把stateProvider包装到一个自己的Provider中,然后在run函数中就可以定义路由,顺带登录认证一起做了,感觉流程简单了不少。但是我直接run一个function A,A中inject[‘$stateProvider‘],却会报错:Error: [$injector:unpr] Unknown provider: $stateProviderProvider <- $stateProvider。
run不能注册provider这是事实,请问你的方式为什么可行呢?

E2E test

Need to cover the following pages:

  • protractor basic settings
  • 404
  • Home
  • Login
  • Dashboard
  • Phone List
  • Add Phone
  • Phone Detail
  • Edit Phone

Error at npm run

npm start

[email protected] start /home/Desktop/github/angular1-webpack-starter
webpack-dev-server --mock

events.js:141
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 0.0.0.0:8080
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at Server._listen2 (net.js:1237:14)
at listen (net.js:1273:10)
at net.js:1382:9
at nextTickCallbackWith3Args (node.js:452:9)
at process._tickCallback (node.js:358:17)
at Function.Module.runMain (module.js:444:11)
at startup (node.js:136:18)
at node.js:966:3

npm ERR! Linux 4.8.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: webpack-dev-server --mock
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'webpack-dev-server --mock'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular1-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --mock
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular1-webpack-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular1-webpack-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/Desktop/github/angular1-webpack-starter/npm-debug.log

Unit test

Try to achieve 100% unit test coverage.

Need to cover the following folders:

  • components/_common/directives/
  • components/_common/services/
  • components/_common/production/
  • components/_layout/
  • components/banner/
  • components/breadcrumb/
  • components/footer/
  • components/header/
  • components/home-hero/
  • components/loading/
  • components/login-form/
  • components/modal
  • components/phone-form
  • components/phone-table
  • components/sidebar
  • components/sidebar-sm
  • components/square-menu
  • pages/404/
  • pages/dashboard/
  • pages/home/
  • pages/login/
  • pages/phone/

resolve problem

不好意思,又来麻烦了,请教一个问题:我没有使用你封装好的RouterHelper,而是采用普通的在config中配置自己的项目,但是在需要登录的界面使用一个resolve:{ Login: ['LoginResolve', function(LoginResolve){return LoginResolve.login();}]}这样的resolve,相比你的{loginResolve: self.Resolve.login}确实很丑,但是angular.config的resolve要注入service没有办法,结果竟然无法工作。

发现是ResolveService.prototype.login.$inject = ['UserAPI', '$q'];这个UserAPI和$q都没有注入进来。我修改了一下这个LoginResolve类,可以正常工作了:

class LoginResolve {
	constructor (UserAPI, $q){
		Object.assign(this, {UserAPI, $q});
	}
	login () {
		const self = this;
		if (self.UserAPI.isLoggedIn() !== true) {
			return self.UserAPI.checkLoggedInStatus()
				 .catch(_error);
		}

		function _error () {
			return self.$q.reject('requireLogin');
		}
	}
}
LoginResolve.$inject = ['UserAPI', '$q'];

为什么你采用self.Resolve.login就可以使用login的inject,而我采用LoginResolve.login()则必须将注入放到LoginResolve再通过login来使用,LoginResolve.login()不会触发login的依赖注入工作吗?非常感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.