toddmotto / angularjs-styleguide

AngularJS styleguide for teams
https://ultimateangular.com
5.96k stars 700 forks source link

Stateless components #87

Closed kurtpeters closed 8 years ago

kurtpeters commented 8 years ago

Is the following todo/todo-form/index.js setup documented correctly?

/* ----- todo/todo-form/index.js ----- */
import angular from 'angular';
import TodoFormComponent from './todo-form.component';

const todoForm = angular
  .module('todo')
  .component('todo', TodoFormComponent)
  .value('EventEmitter', payload => ({ $event: payload});

export default todoForm;

It seems the "todoForm" component declaration is missing, along with the todo module being declared as a circular dependency. Should it be the following (or something similar)?

/* ----- todo/todo-form/index.js ----- */
import angular from 'angular';
import TodoFormComponent from './todo-form.component';

const todoForm = angular
  .module('todo.form', [])
  .component('todoForm', TodoFormComponent)
  .value('EventEmitter', payload => ({ $event: payload});

export default todoForm;
floriangosse commented 8 years ago

Yes, that is correct. You can open a PR. :-)