Moved back to ng1

Change-Id: I43b284e3b3cb3ac19d43c088de988c89a7ea8807
diff --git a/conf/gulp.conf.js b/conf/gulp.conf.js
index ab46d42..730290d 100644
--- a/conf/gulp.conf.js
+++ b/conf/gulp.conf.js
@@ -11,6 +11,8 @@
 const path = require('path');
 const gutil = require('gulp-util');
 
+exports.ngModule = 'app';
+
 /**
  *  The main paths of your project handle these with care
  */
diff --git a/conf/karma-auto.conf.js b/conf/karma-auto.conf.js
index b7e44ab..c0b9509 100644
--- a/conf/karma-auto.conf.js
+++ b/conf/karma-auto.conf.js
@@ -10,21 +10,28 @@
       outputDir: 'test-reports'
     },
     browsers: [
-      // 'Chrome',
       'PhantomJS'
     ],
     frameworks: [
-      'jasmine'
+      'jasmine',
+      'es6-shim'
     ],
     files: [
       'node_modules/es6-shim/es6-shim.js',
-      conf.path.src('index.spec.js')
+      conf.path.src('index.spec.js'),
+      conf.path.src('**/*.html')
     ],
     preprocessors: {
       [conf.path.src('index.spec.js')]: [
         'webpack'
+      ],
+      [conf.path.src('**/*.html')]: [
+        'ng-html2js'
       ]
     },
+    ngHtml2JsPreprocessor: {
+      stripPrefix: `${conf.paths.src}/`
+    },
     reporters: ['mocha', 'coverage'],
     coverageReporter: {
       type: 'html',
@@ -38,10 +45,12 @@
       require('karma-jasmine'),
       require('karma-junit-reporter'),
       require('karma-coverage'),
-      require('karma-chrome-launcher'),
       require('karma-phantomjs-launcher'),
-      require('karma-mocha-reporter'),
-      require('karma-webpack')
+      require('karma-phantomjs-shim'),
+      require('karma-ng-html2js-preprocessor'),
+      require('karma-webpack'),
+      require('karma-es6-shim'),
+      require('karma-mocha-reporter')
     ]
   };
 
diff --git a/conf/karma.conf.js b/conf/karma.conf.js
index 806a6f4..2db6132 100644
--- a/conf/karma.conf.js
+++ b/conf/karma.conf.js
@@ -13,17 +13,25 @@
       'PhantomJS'
     ],
     frameworks: [
-      'jasmine'
+      'jasmine',
+      'es6-shim'
     ],
     files: [
       'node_modules/es6-shim/es6-shim.js',
-      conf.path.src('index.spec.js')
+      conf.path.src('index.spec.js'),
+      conf.path.src('**/*.html')
     ],
     preprocessors: {
       [conf.path.src('index.spec.js')]: [
         'webpack'
+      ],
+      [conf.path.src('**/*.html')]: [
+        'ng-html2js'
       ]
     },
+    ngHtml2JsPreprocessor: {
+      stripPrefix: `${conf.paths.src}/`
+    },
     reporters: ['progress', 'coverage'],
     coverageReporter: {
       type: 'html',
@@ -38,7 +46,10 @@
       require('karma-junit-reporter'),
       require('karma-coverage'),
       require('karma-phantomjs-launcher'),
-      require('karma-webpack')
+      require('karma-phantomjs-shim'),
+      require('karma-ng-html2js-preprocessor'),
+      require('karma-webpack'),
+      require('karma-es6-shim')
     ]
   };
 
diff --git a/conf/webpack-dist.conf.js b/conf/webpack-dist.conf.js
index 3ba4a8a..33f0acb 100644
--- a/conf/webpack-dist.conf.js
+++ b/conf/webpack-dist.conf.js
@@ -4,6 +4,7 @@
 
 const HtmlWebpackPlugin = require('html-webpack-plugin');
 const ExtractTextPlugin = require('extract-text-webpack-plugin');
+const pkg = require('../package.json');
 const autoprefixer = require('autoprefixer');
 
 module.exports = {
@@ -26,6 +27,7 @@
         test: /\.ts$/,
         exclude: /node_modules/,
         loaders: [
+          'ng-annotate',
           'ts'
         ]
       },
@@ -43,13 +45,6 @@
     new HtmlWebpackPlugin({
       template: conf.path.src('index.html')
     }),
-    new webpack.ContextReplacementPlugin(
-      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
-      conf.paths.src
-    ),
-    new webpack.DefinePlugin({
-      'process.env.NODE_ENV': '"production"'
-    }),
     new webpack.optimize.UglifyJsPlugin({
       compress: {unused: true, dead_code: true, warnings: false} // eslint-disable-line camelcase
     }),
@@ -70,7 +65,10 @@
       '.ts'
     ]
   },
-  entry: `./${conf.path.src('index')}`,
+  entry: {
+    app: `./${conf.path.src('index')}`,
+    vendor: Object.keys(pkg.dependencies)
+  },
   ts: {
     configFileName: 'tsconfig.json'
   },
diff --git a/conf/webpack-test.conf.js b/conf/webpack-test.conf.js
index c39b1c4..c271708 100644
--- a/conf/webpack-test.conf.js
+++ b/conf/webpack-test.conf.js
@@ -1,5 +1,3 @@
-const webpack = require('webpack');
-const conf = require('./gulp.conf');
 module.exports = {
   module: {
     preLoaders: [
@@ -9,7 +7,6 @@
         loader: 'tslint'
       }
     ],
-
     loaders: [
       {
         test: /.json$/,
@@ -21,6 +18,7 @@
         test: /\.ts$/,
         exclude: /node_modules/,
         loaders: [
+          'ng-annotate',
           'ts'
         ]
       },
@@ -29,15 +27,19 @@
         loaders: [
           'html'
         ]
+      },
+      {
+        test: /\.(css|scss)$/,
+        loaders: [
+          'style',
+          'css',
+          'sass',
+          'postcss'
+        ]
       }
     ]
   },
-  plugins: [
-    new webpack.ContextReplacementPlugin(
-      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
-      conf.paths.src
-    )
-  ],
+  plugins: [],
   debug: true,
   devtool: 'source-map',
   resolve: {
diff --git a/conf/webpack.conf.js b/conf/webpack.conf.js
index f7830ce..56f2611 100644
--- a/conf/webpack.conf.js
+++ b/conf/webpack.conf.js
@@ -35,6 +35,7 @@
         test: /\.ts$/,
         exclude: /node_modules/,
         loaders: [
+          'ng-annotate',
           'ts'
         ]
       },
@@ -51,11 +52,7 @@
     new webpack.NoErrorsPlugin(),
     new HtmlWebpackPlugin({
       template: conf.path.src('index.html')
-    }),
-    new webpack.ContextReplacementPlugin(
-      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
-      conf.paths.src
-    )
+    })
   ],
   postcss: () => [autoprefixer],
   debug: true,