Merge tag 'v1.0.0'

v1.0.0
Add secondary karma reporter: junit

The karma-xunit.xml file should be picked up by Jenkins and treated appropriately
Ignore CI generated files
Merge pull request #20 from strongloop/feature/ci-friendly-karma

Add junit reporter to karma for improved CI stats and add CI generated files to .gitignore.
Remove bin/ scripts.

The scripts were moved to loopback-angular-cli.

This is fixing the incomplete pull request #13.
Merge pull request #27 from strongloop/feature/fixup-cli-removal

Remove bin/ scripts
Remove mocha-as-promised.

Mocha provides native support for promises as of v1.18.
Update all dependencies to latest versions.

Also change semver range to use ^ instead of ~ and remove unused
karma modules.
package.json: remove bin scripts
Merge pull request #28 from strongloop/feature/upgrade-loopback-deps

Upgrade dependencies, clean up package.json
test-server: exit when child process failed

Improve handling of errors reported by the spawned child:
 - include more info in the error message printed to console
 - exit the process (it is kept alive by the http server)
npm test: remove dependency on global karma-cli

The npm module karma does not expose the "karma" binary via package.json
bin scripts, developers are advised to install global karma-cli.

To make the life of CI server easier, the "npm test" script is modified
to "./node_modules/karma/bin/karma" instead of "karma".
Merge pull request #31 from strongloop/feature/fix-jenkins-build

Feature/fix jenkins build
Template refactoring: extract ngdocForMethod

Extract the template of ngdoc comment for a resource method into
a function.

No changes of functionality.
Support internal and @deprecated methods in ngdoc
Allow e2e tests to run custom setup code on server

Sample usage:

// data for the POST /setup request
JSON.stringify({
  models: {
    Product: { properties: { name: 'string' } },
  },
  setupFn: (function(app, cb) {
    app.models.Product.create(
      { name: 'a-product' },
      function(err, product) {
        if (err) return cb(err);
        cb(null, { productId: product.id }
      });
  }).toString()
})

The server will run the provided function and wait until the callback
is called. Data passed to the callback are exposed to browser tests
as "testData" and can be accessed via the angular injector:

  $injector.get("testData").productId
Prevent reuse of model classes between tests

The LoopBack keeps all models in a static registry. When two tests
are using the same model name, some of the model classes may get shared,
causing bugs difficult to debug.

This commit modifies "/setup" handler to reset the static registry
to the initial state every time a new application is created.
Support hasAndBelongsToMany scope methods

The relation "Product hasAndBelongsToMany Category" creates a scope
property on the Product model with three methods: get, create, delete.

At the Angular side, these methods are defined on the Product $resource,
therefore they return the result as Product instead of Category.

The solution presented in this commit has two parts:

 1. The Category $resource has internal methods calling remote (REST)
    Product.categories.* methods. This way the result is returned
    as Category.

 2. The Product $resource has extra properties (methods) with hand-coded
    implementation delegating to the internal Category methods.

Methods & delegations:
  Product.categories()
    -> Category['::get::Product::categories']()

  Product.categories.create()
    -> Category['::create::Product::categories']()

  Product.categories.destroyAll()
    -> Category['::delete::Product::categories']()

The original scope methods (e.g. prototype$__get__{scope}) are marked
as deprecated, the deprecation text includes the name of the new method
to use.
sharedCtor arguments in ngdoc of prototype methods

The URL of prototype methods includes sharedCtor parameters like ":id",
for example

  GET /api/Products/:id/categories

Because all $resource actions are static (non-prototype) in ngResource,
callers has to include sharedCtor parameters in the arguments.

  Product.categories({ id: productId });

This commit modifies the generated ngdoc to include sharedCtor
parameters in actions for prototype methods.
Merge pull request #29 from strongloop/feature/get-related-models

Access models related via hasAndBelongsToMany