Coder Social home page Coder Social logo

robbiethewagner / angular-styleguide-es6 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnpapa/angular-styleguide

223.0 223.0 28.0 3.54 MB

Angular Style Guide ES2015/ES6: A starting point for Angular teams to provide consistency through good practices.

License: MIT License

angular-styleguide-es6's Introduction

rwwagner90's GitHub stats

angular-styleguide-es6's People

Contributors

albertoimpl avatar angelochiello avatar binggg avatar bogatinov avatar byjoshuadavis avatar djyde avatar ericlemerdy avatar ewertoncodes avatar fta1 avatar gaboesquivel avatar ingilniero avatar jedgell avatar jeffsheets avatar jlcarvalho avatar jmiazga avatar jodytate avatar johnpapa avatar limonte avatar lucious7 avatar mazhekin avatar noritamago avatar pizzapete avatar richardlitt avatar robbiethewagner avatar robertd avatar tomoyukikashiro avatar vinicius-sabadim avatar vinicius33 avatar wardbell avatar zachlysobey 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-styleguide-es6's Issues

Component guide

Nice abstraction of original guide to ES6 format.

How about including a section for Angular Components (those introduced in 1.5)

I have a nice abstraction convention myself, but would be curious how it compares to others.

Use of Angular setter getter

I think using the setter/getter can be permitted but only once at the entry point of ones app. With the ES6 module syntax you can load your components and pass the angular app variable as an argument. It makes your code really modular that way.

Example from my ES6 Webpack Example:

const app = angular.module('app', ['ui.router']);

// Components Entrypoint
appComponents(app);

// Common Components Entrypoint
commonComponents(app);

// App Services Entrypoint
appServices(app);

non-working "reccomended" example

y022

/* recommended */
angular
    .module('app')
    .controller('SomeController', SomeController);

class SomeController {
  constructor() { }
}

ES6 classes are not hoisted as I understand it, and as such, this example will not work. SomeController will not be defined here before it is used.

factory example is not complete

Hello,

I think this snipped out of your docs doesn't work at all:

/* recommended */

// dataservice factory
angular
    .module('app.core')
    .factory('dataservice', dataservice);

class dataservice { 
  constructor($http, logger) {
    this.$http = $http;
    this.logger = logger;
  }
  getAvengers() {
    return this.$http.get('/api/maa')
      .then(getAvengersComplete)
      .catch(getAvengersFailed);

    getAvengersComplete(response) => {
      return response.data.results;
    }

    getAvengersFailed(error) => {
      this.logger.error('XHR Failed for getAvengers.' + error.data);
    }
  }
}

A service is not able to take a class constructor. I used .factory('dataservice',() => new dataservice()) but then this.$httpwould be undefined...
Any idea how to solve this?
Cheers

No mention of exports

import is described, but not export. For consistent placement, it should be documented. Perhaps at the bottom of the file, rather than inline per declaration.

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.