Git Product home page Git Product logo

angular_es6's Introduction

Build Your Own AngularJS in ES6

This repo is a port of the brilliant Build Your Own AngularJS code from https://github.com/teropa/build-your-own-angularjs using ES6 features.

Reasons for implementing in ES6

  • Forces me to learn ES6 in the context of a framework
  • More challenging than copying the code directly from the BYOAJS repo
  • Still get to learn the internals of AngularJS (even though I'm a bit late to the party)

Tips for Testing

When I first started this repo I was implementing the unit tests again in ES6. This was very tedious as I was hoping to get through the book in a few session. My workaround has been to integrate the unit test (ES5) code from the main BYOAJS repo with my re-written code in the /src directory. To do this I set teropa's BYOAJS repo as a remote (including tags) and can pull in unit-tests on a chapter by chapter basis with the following command:

git checkout tags/<chapter tag> -- test/*

The downside to my laziness in not wanting to modify the test code is that it relies on the CommonJS pattern of module loading and I would ideally like to use ES6 modules. The current workaround is to translate the ES6 modules to CommonJS but this requires adding the '.default' to each require statement in the ES5 tests (http://www.2ality.com/2015/12/babel-commonjs.html) when the module is imported (less than ideal as each test file still needs to be modified slightly).

Updates from Original BYOAJS Repo

  • Updated to Phantomjs2 headless browser for testing
  • Removed jshint in favour of eslint for automatic linting in VS code
  • Utilized Babel and babel-preset-env to pull in polyfills for ES6 features not supported by PhantomJS (Symbols, etc.)

angular_es6's People

Contributors

kmontg avatar teropa avatar

Watchers

James Cloos avatar  avatar

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.