Giter Club home page Giter Club logo

ng6-starter's Introduction

ng6-starter

NG6 Join Slack Join the chat at https://gitter.im/angularclass/NG6-starter

The de facto starter repo for building scalable apps with Angular, ES6, and Webpack

This repo serves as a minimal starter for those looking to get up-and-running with Angular and ES6, using Gulp and Webpack for the build process. This seed is not a Yeoman generator. It's a minimal starter with tasks for building the boilerplate. These are its features:

  • The best practice in directory/file organization for Angular (allowing for infinite horizontal app scaling)
  • A ready-to-go build system for working with ES6
  • Tasks for generating additional boilerplate Angular components
  • A full testing system in place
  • SASS support via node-sass

Check out the JSPM version--an alternative to Webpack as an ES6 build system.

If you're looking for a preliminary Angular 2 build, please use the angular2-webpack-starter.


Table of Contents

Walkthrough

Build System

NG6 uses NPM scripts, Gulp, and Webpack together for its build system. Yes, you don't need Gulp if you're using Webpack. This is true if your build system is only responsible for file manipulation. However, ours is not.

Webpack handles all file-related concerns:

  • Transpiling from ES6 to ES5 with Babel
  • Loading HTML files as modules
  • Transpiling stylesheets and appending them to the DOM
  • Refreshing the browser and rebuilding on file changes
  • Hot module replacement for transpiled stylesheets
  • Bundling the app
  • Loading all modules
  • Doing all of the above for *.spec.js files as well

Gulp is the orchestrator:

  • Starting and calling Webpack
  • Starting a development server (yes, Webpack can do this too)
  • Generating boilerplate for the Angular app

Check out the JSPM version--an alternative to Webpack as an ES6 build system.

File Structure

We use a componentized approach with NG6. This will be the eventual standard (and particularly helpful, if using Angular's new router) as well as a great way to ensure a tasteful transition to Angular 2, when the time is ripe. Everything--or mostly everything, as we'll explore (below)--is a component. A component is a self-contained concern--may it be a feature or strictly-defined, ever-present element of the UI (such as a header, sidebar, or footer). Also characteristic of a component is that it harnesses its own stylesheets, templates, controllers, routes, services, and specs. This encapsulation allows us the comfort of isolation and structural locality. Here's how it looks:

client
⋅⋅app/
⋅⋅⋅⋅app.js * app entry file
⋅⋅⋅⋅app.html * app template
⋅⋅⋅⋅common/ * functionality pertinent to several components propagate into this directory
⋅⋅⋅⋅components/ * where components live
⋅⋅⋅⋅⋅⋅components.js * components entry file
⋅⋅⋅⋅⋅⋅home/ * home component
⋅⋅⋅⋅⋅⋅⋅⋅home.js * home entry file (routes, configurations, and declarations occur here)
⋅⋅⋅⋅⋅⋅⋅⋅home.component.js * home "directive"
⋅⋅⋅⋅⋅⋅⋅⋅home.controller.js * home controller
⋅⋅⋅⋅⋅⋅⋅⋅home.scss * home styles
⋅⋅⋅⋅⋅⋅⋅⋅home.html * home template
⋅⋅⋅⋅⋅⋅⋅⋅home.spec.js * home specs (for entry, component, and controller)

Testing Setup

All tests are also written in ES6. We use Webpack to take care of the logistics of getting those files to run in the various browsers, just like with our client files. This is our testing stack:

  • Karma
  • Webpack + Babel
  • Mocha
  • Chai

To run tests, type npm test in the terminal. Read more about testing below.

Getting Started

Dependencies

Tools needed to run this app:

  • node and npm

Installing

  • fork this repo
  • clone your fork
  • npm install to install dependencies

Running the App

NG6 uses Gulp to build and launch the development environment. After you have installed all dependencies, you may run the app. Running npm start will bundle the app with webpack, launch a development server, and watch all files. The port will be displayed in the terminal.

Tasks

Here's a list of available tasks:

  • npm run build
    • runs Webpack, which will transpile, concatenate, and compress (collectively, "bundle") all assets and modules into dist/bundle.js. It also prepares index.html to be used as application entry point, links assets and created dist version of our application.
  • npm run serve
    • starts a dev server via webpack-dev-server, serving the client folder.
  • npm run watch
    • alias of serve
  • npm start (which is the default task that runs when typing gulp without providing an argument)
    • runs serve.
  • npm run component
    • scaffolds a new Angular component. Read below for usage details.

Testing

To run the tests, run npm test.

Karma combined with Webpack runs all files matching *.spec.js inside the app folder. This allows us to keep test files local to the component--which keeps us in good faith with continuing to build our app modularly. The file spec.bundle.js is the bundle file for all our spec files that Karma will run.

Be sure to define your *.spec.js files within their corresponding component directory. You must name the spec file like so, [name].spec.js. If you don't want to use the .spec.js suffix, you must change the regex in spec.bundle.js to look for whatever file(s) you want. Mocha is the testing suite and Chai is the assertion library. If you would like to change this, see karma.conf.js.

Examples

It's always easier to learn something if you have an examples. Here is a list of repos which based on this starter:

Generating Components

Following a consistent directory structure between components offers us the certainty of predictability. We can take advantage of this certainty by creating a gulp task to automate the "instantiation" of our components. The component boilerplate task generates this:

⋅⋅⋅⋅⋅⋅componentName/
⋅⋅⋅⋅⋅⋅⋅⋅componentName.js // entry file where all its dependencies load
⋅⋅⋅⋅⋅⋅⋅⋅componentName.component.js
⋅⋅⋅⋅⋅⋅⋅⋅componentName.controller.js
⋅⋅⋅⋅⋅⋅⋅⋅componentName.html
⋅⋅⋅⋅⋅⋅⋅⋅componentName.scss // scoped to affect only its own template
⋅⋅⋅⋅⋅⋅⋅⋅componentName.spec.js // contains passing demonstration tests

You may, of course, create these files manually, every time a new module is needed, but that gets quickly tedious. To generate a component, run npm run component -- --name componentName.

The parameter following the --name flag is the name of the component to be created. Ensure that it is unique or it will overwrite the preexisting identically-named component.

The component will be created, by default, inside client/app/components. To change this, apply the --parent flag, followed by a path relative to client/app/components/.

For example, running npm run component -- --name signup --parent auth will create a signup component at client/app/components/auth/signup.

Running npm run component -- --name footer --parent ../common creates a footer component at client/app/common/footer.

Because the argument to --name applies to the folder name and the actual component name, make sure to camelcase the component names.

Starter Kit Support and Questions

Contact us, anytime, regarding anything about this project.


enjoy — PatrickJS

ng6-starter's People

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  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

ng6-starter's Issues

Component binding is not working as expected

It may be due to fact that the repository is missing an example, but component binding is not working as expected: The parameters are not passed/bind to controllers.

<hero value="foo"></hero>
// hero.component.js
import template from './hero.html';
import controller from './hero.controller';

let heroComponent = {
  restrict: 'E',
  bindings: {
    value: '@'
  },
  template,
  controller,
  controllerAs: 'vm'
};
class HeroController {
  constructor() {
    this.name = 'hero';
    console.log(this.value); // undefined!
  }
}
<section class="hero">
  <h1>This is the NG6 starter</h1>
  <!-- Value is also undefined within template -->
  <h3>You can find me inside {{ vm.name }}.html {{ vm.value }}</h3>
</section>

A bug or user error?

[JSPM] Unable to calculate canonical name with gulp build

Hi,

Not sure if this topic has been already raised, i got trouble with a fresh clone of the repo (jspm branch) when I tried to build the app with "gulp build":

Error: Unable to calculate canonical name to bundle file:///f:/ng6/NG6-starter/../app.js
    at getCanonicalNamePlain (f:\webapp\ng6\NG6-starter\node_modules\jspm\node_modules\systemjs-builder\lib\utils.js:177:13)
    at getCanonicalName (f:\webapp\ng6\NG6-starter\node_modules\jspm\node_modules\systemjs-builder\lib\utils.js:88:19)
    at f:\ng6\NG6-starter\node_modules\jspm\node_modules\systemjs-builder\lib\arithmetic.js:84:38
    at process._tickCallback (node.js:366:9)

My relative path problem has been 'solved' when i replaced l.19 in Gulpfile.js by:

return path.relative(root, path.resolve(path.join(root, resolvePath, glob)));

Does anyone already encounter this issue on windows and solved it in a cleaner way?
Thanks

Error with CSS loader in build task

As referenced in #25, when running gulp build task in jspm branch, an error occurs that originates from the CSS plugin

Broken @import declaration of "client\app\common\navbar\navbar.css"
Broken @import declaration of "client\app\common\hero\hero.css"
Broken @import declaration of "client\app\components\home\home.css"
Broken @import declaration of "client\app\components\about\about.css"
Broken @import declaration of "client\app\app.css"
Broken @import declaration of "jspm_packages\github\necolas\[email protected]\normalize.css"
    at Loader.bundle (file:D:/ILM/GithubForks/NG6-starter/jspm_packages/github/systemjs/[email protected]/css-builder.js:48:11)
    at file:D:/ILM/GithubForks/NG6-starter/jspm_packages/github/systemjs/[email protected]/css.js:83:22
    at tryCatchReject (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:1183:30)
    at runContinuation1 (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:1142:4)
    at Fulfilled.when (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:930:4)
    at Pending.run (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:821:13)
    at Scheduler._drain (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:97:19)
    at Scheduler.drain (D:\ILM\GithubForks\NG6-starter\node_modules\jspm\node_modules\systemjs\node_modules\es6-module-loader\dist\es6-module-loader.src.js:62:9)
    at process._tickCallback (node.js:355:11)

SyntaxError: Use of const in strict mode

Hi, getting the following error trying to run Gulp for the NG6-starter-jspm version. Have I missed the install of a transpiler? From what I can see all the Node modules seem to be in place. Still a novice with this technology, any help would be much appreciated.
Cheers, Colin

E:\AngularJS\ES2015\NG6-starter-jspm>gulp
[20:32:56] Using gulpfile E:\AngularJS\ES2015\NG6-starter-jspm\Gulpfile.js
[20:32:56] Starting 'serve'...
[20:32:56] 'serve' errored after 2.4 ms
[20:32:56] E:\AngularJS\ES2015\NG6-starter-jspm\node_modules\chokidar-socket-emi
tter\server.js:2
const chokidar = require('chokidar')
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Gulp. (E:\AngularJS\ES2015\NG6-starter-jspm\Gulpfile.js:38:2)
at module.exports (E:\AngularJS\ES2015\NG6-starter-jspm\node_modules\gulp\no
de_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (E:\AngularJS\ES2015\NG6-starter-jspm\node_mod
ules\gulp\node_modules\orchestrator\index.js:273:3)

Cannot find module 'chai' immediately after setup

I followed the setup instructions (clone then npm install), and when I run gulp, everything starts fine. But if I run npm test, I get this error:

module.js:338
    throw err;
    ^

Error: Cannot find module 'chai'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.require.resolve (module.js:388:19)

I see karma-chai is a dependency, and it is installed in node_modules.

I am using node v4.1.2 and npm 3.3.6.

jspm logo

our logo for the jspm branch has webpack on it

[JSPM] Uncaught ReferenceError: System is not defined

Now that we have successful builds, I'm having an issue actually loading the site from the dist directory. As far as environment, I'm using Node v4.1.1and NPM v3.3.8 along with node-static to host the dist directory.

It looks like there are a chunk of System.register invocations at the bottom of the bundle. The issue here is that System is aliased as $__System everywhere else in the bundle.

image

I messed with this for a while this morning and didn't get anywhere. There are a number of issues that sound similar to this one such as this -- however it documents the problem as being solved.

Being that this is just a starter project, I propose maybe we just do this.

How to use resolve

Guys, with this syntax:

$stateProvider
        .state('home', {
            url: '/',
            template: '<home></home>'
        });

It's possible to use resolve? Or do we need a controller property in the state in order to use it?

Thank you.

Heroku or Divshot build

I would like to build my app, upload it and run on services like Heroku or Divshot. At the moment, it's not clear how to do it using NG6-starter. Can you provide some build process and add a proper section to documentation on how to to that in the best way?

Karma Testing Dep

karma-chai
karma-webpack

are missing from the devDeps in package.json and required to be installed to run the tests.

gulpfile.babel.js

please update gulpfile to es6 babel via gulpfile.babel.js. All that is needed is to change the name and use es6

Not able to install Dependencies

I followed the Getting Started Guide of the JSPM Branch, but I'm not able get the project running, since npm i is failing every time.

I get following error with a socket.io dependency:

warn github:socketio/[email protected] dependency installs skipped as it's a GitHub package with no registry property set.
     If the dependencies aren't needed ignore this message. Alternatively set a registry or dependencies override or use the npm registry version at jspm install npm:socket.io-client@^1.3.7 instead.

and also with the tty-browserify package:

Looking up npm:tty-browserify

warn Error on download for github:jspm/nodelibs-tty
     Error: getaddrinfo ENOTFOUND
         at errnoException (dns.js:37:11)
         at Object.onanswer [as oncomplete] (dns.js:124:16)

warn Error on download for github:jspm/nodelibs-net
     Error: getaddrinfo ENOTFOUND
         at errnoException (dns.js:37:11)
         at Object.onanswer [as oncomplete] (dns.js:124:16)

err  Error downloading github:jspm/nodelibs-tty.

I tried to reinstall with cleared caches (npm cache clear and jspm cc), but this didn't help.

Edit: Github credentials are configured via jspm registry config github.
Edit2: OSX 10.11, JSPM v0.16.17, Node.js v0.10.33, NPM v3.3.5.

Karma testing does not seem to work

I followed the instructions and everything installed, but when I run karma start I get the following warnings:

WARN [reporter]: Can not load "mocha", it is not registered!
Perhaps you are missing some plugin?
WARN [watcher]: Pattern "/Users/Quirksmode/Downloads/NG6-starter-jspm/client/jspm_packages/es6-module-loader.js" does not match any file.
INFO [karma]: Karma v0.12.36 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome

using new router

Hi,
The resolve for ui-router is neatly described in an other thread.
How would one go about to resolve with the new router?

Thank you

service and filter ... in es6 syntax ?

thanks for the work !

i am confused about how to use angular service provider and filter ... in this es6 class-based repo , can you give me some demo?

Gulp build on jspm branch fails

When I run gulp build on the jspm branch the build task fails. I don't know enough yet about jspm to understand if this is an issue with the gulp task.

From what I can see, the bundling process is looking for common/common.js file in the wrong location (not relative to app folder).

    $ gulp build
[13:10:11] Using gulpfile c:\dev\tutorials\NG6-starter\Gulpfile.js
[13:10:11] Starting 'build'...
[13:10:12] 'build' errored after 1.27 s
[13:10:12] Error: Error loading "common/common" at file:c:/dev/tutorials/NG6-starter/common/common.js
Error loading "common/common" from "client\app\app" at file:c:/dev/tutorials/NG6-starter/client/app/app.js
ENOENT, open 'c:\dev\tutorials\NG6-starter\common\common.js'
    at Error (native)

Add example of testing a component

It would be helpful to have an example or two of compiling a template so that you can do things like expect(component.find('element').text()).to.be.... I'm fairly new to setting up directive tests, and having trouble getting them set up with this starter repo.

On the same note, what is the best way to turn the template string that is available in the unit test into a testable directive?

help want

Hi, i had download the repo to local, and followed the guide.

but when i ran gulp, an error throwed:

module.js:338
    throw err;
          ^
Error: Cannot find module 'immutable'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (D:\project\ng-starter\node_modules\browser-sync\lib\h
ooks.js:4:20)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

My computer environment is :

win7
node -v 
v0.12.0
npm -v 
2.11.2

Problem with ui-router url resolving

I'm having trouble navigating to localhost:3000/anypath using a new tab in chrome instead of going to localhost:3000 then clicking a link that directs me to localhost:3000/anypath

Is there a setting in the gulpfile.babel.js or in the ui-router setup that I need to change in order to allow this functionality?

Repeating of dependencies

I really really hate this pattern when you have to list your dependency twice

import angular from 'angular';
import Home from './home/home';
import About from './about/about';

let componentModule = angular.module('app.components', [
  Home.name,
  About.name
]);

export default componentModule;

In AMD I used to do this:

var angular = require('angular');
var moduleId = require('module').id;
var componentModule = angular.module(moduleId, [
  require('./home/home'),
  require('./about.name')
]);
return moduleId;

Any ideas how to improve it in ES6?

how angular-es6 inheritance should be provided?

Parent-child relationship between controllers, directives.
In es5-angular these relationship are implemented using scope and scope inheritance.
Now we use classes, extends, super methods.

But my problem is when I create directive class and then controller class that uses some data from directive class, controller class will be a child of directive class, but in this case directive class constructor will be called 2 times, so I got an error : Multiple directives [searchBar (module: ontour), searchBar (module: ontour)] asking for template on.

It's a big question, i can't find any examples of it in this boilerplate and articles on web.

Testing Controllers with Injected Services

hi.
In the spec example of "home" component, a controller is created with the new operator.
what if, a controller is injected with services?
how should that be addressed?
i.e.:

// Given the controller is injected with these:
class HomeController {
  constructor(Users, $http, $stateParams) {
    this.name = 'home';
  }
}

export default HomeController;

Should I use the $controller in the injector?

beforeEach(inject((_$rootScope_, $controller) => {
    $rootScope = _$rootScope_;
    scope = $rootScope.$new();
    makeController = () => {
      return $controller('HomeController as vm', { $scope: scope });
    };
  }));

Thanks.

Cannot Find module 'dateformat'

Off a fresh install - running gulp outputs:

Error: Cannot find module 'dateformat'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/gulp-util/index.js:5:9)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

Anything I'm missing here

Cannot find module 'clone-stats'

node v.5.1.0, Windows 10 x64

I run npm i or npm i clone-stats, but get error:

module.js:340
    throw err;
    ^

Error: Cannot find module 'clone-stats'

I removed node-modules folder and reinstalled modules without positive result

How to create a directive with attributes?

I've been struggling with this all weekend... How do you use this style of component definition with a custom directive which takes an attribute? That is...

Any pointers to a working example would be great...

no gulpfile.js

There is a gulpfile.babel.js file at the root, how to run gulp tasks from that file?

Dependencies not working when add UglifyJsPlugin plugin into webpack

Here my webpack.config.js

var webpack = require("webpack");
module.exports = {
  devtool: 'sourcemap',
  output: {
    filename: 'bundle.js'//,
    //path: './build'
  },
  plugins:[
    new webpack.optimize.UglifyJsPlugin()
  ],
  module: {
    preLoaders: [{
      test:    /\.js$/,
      exclude: [/app\/lib/, /node_modules/],
      loader:  'jshint!jscs'
    }],
    postLoaders: [
      { test: /\.js$/, exclude: [/app\/lib/, /node_modules/], loader: 'babel' },
      { test: /\.html$/, loader: 'raw' },
      { test: /\.styl$/, loader: 'style!css!stylus' },
      { test: /\.css$/, loader: 'style!css' }
    ]
  }
};

Here the error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.components due to:
Error: [$injector:modulerr] Failed to instantiate module home due to:
Error: [$injector:unpr] Unknown provider: e

Here my home module:

import angular from 'angular';
import uiRouter from 'angular-ui-router';
import ngSanitize from 'angular-sanitize';
import homeComponent from './home.component';

let homeModule = angular.module('home', [
  uiRouter,
  ngSanitize
])

.config(($stateProvider, $urlRouterProvider) => {
  $urlRouterProvider.otherwise('/');

  $stateProvider
    .state('home', {
      url: '/',
      template: '<home></home>'
    });
})

.directive('home', homeComponent);

export default homeModule;

using karma-coverage giving errors

i am learning to include code coverage for unit testing the angularjs project. i started by referencing this project by including my karma coverage in the karma config

module.exports = function (config) {
config.set({
...

// list of files/patterns to load in the browser
files: [
  'client/app/**/**/!(*spec).js',
  'client/app/**/!(*spec).js',
  'client/app/!(*spec).js',
  {pattern: 'spec.bundle.js', watched: false}
],

// files to exclude
exclude: [],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
  'client/app/**/**/!(*spec).js': ['webpack', 'sourcemap', 'coverage'], 
  'client/app/**/!(*spec).js': ['webpack', 'sourcemap', 'coverage'],  
  'client/app/!(*spec).js': ['webpack', 'sourcemap', 'coverage'],
  'spec.bundle.js': ['webpack', 'sourcemap'] 
},

webpack: {
  devtool: 'inline-source-map',
  module: {
    loaders: [
      { test: /\.js/, exclude: [/app\/lib/, /node_modules/], loader: 'babel' },
      { test: /\.html/, loader: 'raw' },
      { test: /\.styl$/, loader: 'style!css!stylus' },
      { test: /\.css$/, loader: 'style!css' }
    ]
  }
},

webpackServer: {
  noInfo: true // prevent console spamming when running in Karma!
},

// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha', 'coverage'],

...
});
};

However , i am getting errors :

Module not found: Error: a dependency to an entry point is not allowed
@ ./client/app/common/hero/hero.spec.js 13:21-48

ERROR in ./client/app/components/about/about.spec.js
Module not found: Error: a dependency to an entry point is not allowed
@ ./client/app/components/about/about.spec.js 5:13-31

ERROR in ./client/app/components/about/about.spec.js
Module not found: Error: a dependency to an entry point is not allowed
@ ./client/app/components/about/about.spec.js 9:23-52

ERROR in ./client/app/components/about/about.spec.js
Module not found: Error: a dependency to an entry point is not allowed
@ ./client/app/components/about/about.spec.js 13:22-50
28 10 2015 09:46:11.957:INFO [karma]: Karma v0.13.14 server started at http://lo
calhost:9876/
28 10 2015 09:46:11.992:INFO [launcher]: Starting browser Chrome
28 10 2015 09:46:12.782:INFO [Chrome 46.0.2490 (Windows 8.1 0.0.0)]: Connected o
n socket QXFM-Xx_2Wtah3ArAAAA with id 79300169
Chrome 46.0.2490 (Windows 8.1 0.0.0) ERROR
Uncaught Error: Cannot find module "./common/common"
at D:/NG6-starter/NG6-starter-master/client/app/app.js:9 <- client/app/app.js:
1:24

gulp error

 NG6-starter-master git:(master)  gulp
[00:59:25] Requiring external module babel-core/register
[00:59:25] Using gulpfile ~/code/react_playground/func-pl/NG6-starter-master/gulpfile.babel.js
[00:59:25] Starting 'default'...
[00:59:25] Starting 'webpack'...
[00:59:29] Version: webpack 1.12.2
        Asset     Size  Chunks             Chunk Names
    bundle.js   1.3 MB       0  [emitted]  main
bundle.js.map  1.51 MB       0  [emitted]  main
[00:59:29] Finished 'webpack' after 3.32 s
[00:59:29] Starting 'serve'...
[00:59:29] Finished 'serve' after 133 ms
[00:59:29] Starting 'watch'...
[00:59:29] Finished 'watch' after 17 ms
[00:59:29] Finished 'default' after 3.47 s

module.js:340
    throw err;
    ^
Error: Cannot find module 'connect-history-api-fallback'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at startServer (/Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/browser-sync-ui/lib/server.js:70:13)
    at Object.module.exports.startServer [as fn] (/Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/browser-sync-ui/lib/async.js:91:41)
    at /Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/browser-sync-ui/lib/UI.js:184:14
    at iterate (/Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/async-each-series/index.js:8:5)
    at /Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/async-each-series/index.js:16:16
    at /Users/xieyiming/code/react_playground/func-pl/NG6-starter-master/node_modules/browser-sync/node_modules/browser-sync-ui/lib/UI.js:192:13

clean up jspm readme

Our jspm readme still has some references to webpack such as we use webpack for tests

Export only modules names

Currently we have something like this:

// app/components/something/something.js
let someModule = angular.module('something.module', [depA, depB]);

export default someModule;
// app/app.js
import someModule from './something/something';

angular.module('app', [someModule.name]);

I have two questions:

  1. why we are using let keyword? Module instance should be immutable (const keyword), isn't it?
  2. why we are exporting module but not only it's name?
// app/components/something/something.js
export default angular
    .module('app.something', [depA, depB])
    .name;
// app/app.js
import something from './something/something';

angular.module('app', [something]);

Injecting Services?

How to go about injecting a service into a controller, I have tried .service('tickerTapeService', tickerTapeService) as well as importing it in the controller itself. Can't seem to find solution or documentation.

Typescript support

This repo serves as a good starting point setting up a project. Any chance we could see typescript as webpack loader instead of Babel?

E2E Testing?

Are there any plans to add E2E tests with protractor?

Please don't recommend to block user zooming on mobile

These attributes to block user from zooming is a very hostile practice:

<meta name="viewport" content="..., maximum-scale=1, user-scalable=no">

It forces users with impaired vision into reading uncomfortable sized text or leaving the site for good.
It is especially harmful recommendation in a framework with many developers simply copying the files without thinking about the consequences.
If people need to zoom your site, they have a reason to do so and nothing can put them off more if they can't do it. No design is possible to accommodate everyone at the same time, and letting user to zoom is a very simple solution. Why blocking it is simply beyond my understanding. People will leave your site and you won't even know why!

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.