Skip to content

Commit

Permalink
Adding all the files
Browse files Browse the repository at this point in the history
  • Loading branch information
SudhirVeerakamaraj committed Dec 28, 2016
1 parent b14eaca commit 2bca0a2
Show file tree
Hide file tree
Showing 55 changed files with 7,705 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
npm-debug*
7 changes: 7 additions & 0 deletions config/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;
21 changes: 21 additions & 0 deletions config/karma-test-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Error.stackTraceLimit = Infinity;

require('core-js/es6');
require('core-js/es7/reflect');

require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/proxy');
require('zone.js/dist/sync-test');
require('zone.js/dist/jasmine-patch');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');

var appContext = require.context('../src', true, /\.spec\.ts/);

appContext.keys().forEach(appContext);

var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser-dynamic/testing');

testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
37 changes: 37 additions & 0 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var webpackConfig = require('./webpack.test');

module.exports = function (config) {
var _config = {
basePath: '',

frameworks: ['jasmine'],

files: [
{pattern: './config/karma-test-shim.js', watched: false}
],

preprocessors: {
'./config/karma-test-shim.js': ['webpack', 'sourcemap']
},

webpack: webpackConfig,

webpackMiddleware: {
stats: 'errors-only'
},

webpackServer: {
noInfo: true
},

reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['PhantomJS'],
singleRun: true
};

config.set(_config);
};
59 changes: 59 additions & 0 deletions config/webpack.common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var helpers = require('./helpers');

module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'app': './src/main.ts'
},

resolve: {
extensions: ['', '.js', '.ts']
},

module: {
loaders: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader']
},
{
test: /\.html$/,
loader: 'html'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file?name=assets/[name].[hash].[ext]'
},
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
loader: 'raw'
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style-loader','css-loader!less-loader'),
exclude:/node_modules/
}
]
},

plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
}),

new HtmlWebpackPlugin({
template: 'src/index.html'
}),
new ExtractTextPlugin("[name].css")
]
};
24 changes: 24 additions & 0 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var webpackMerge = require('webpack-merge');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonConfig = require('./webpack.common.js');
var helpers = require('./helpers');

module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',

output: {
path: helpers.root('dist'),
publicPath: 'http://localhost:8080/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},

plugins: [
new ExtractTextPlugin('[name].css')
],

devServer: {
historyApiFallback: true,
stats: 'minimal'
}
});
38 changes: 38 additions & 0 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var webpack = require('webpack');
var webpackMerge = require('webpack-merge');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonConfig = require('./webpack.common.js');
var helpers = require('./helpers');

const ENV = process.env.NODE_ENV = process.env.ENV = 'production';

module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',

output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},

htmlLoader: {
minimize: false // workaround for ng2
},

plugins: [
new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
}
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
})
]
});
37 changes: 37 additions & 0 deletions config/webpack.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var helpers = require('./helpers');

module.exports = {
devtool: 'inline-source-map',

resolve: {
extensions: ['', '.ts', '.js']
},

module: {
loaders: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader']
},
{
test: /\.html$/,
loader: 'html'

},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'null'
},
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
loader: 'null'
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
loader: 'raw'
}
]
}
}
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./config/karma.conf.js');
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "iasset-tech-test-ui",
"version": "1.0.0",
"description": "This is iAsset tech test sample app",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --inline --progress --port 8080",
"test": "karma start",
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
"postinstall": "typings install"
},
"license": "MIT",
"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular2-material/button": "^2.0.0-alpha.8-2",
"@angular2-material/core": "^2.0.0-alpha.8-2",
"@types/hammerjs": "^2.0.33",
"angular2-template-loader": "^0.4.0",
"awesome-typescript-loader": "^2.2.4",
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.15.0",
"jasmine-core": "^2.4.1",
"karma": "^1.2.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "^2.1.7",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.2",
"style-loader": "^0.13.1",
"typescript": "^2.0.2",
"typings": "^1.3.2",
"webpack": "^1.13.0",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.14.0"
}
}
Empty file added public/css/styles.css
Empty file.
Binary file added public/images/angular.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.no-padding{
padding:0 !important;
}
9 changes: 9 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="container">
<div class="well col-sm-12">
<h3>Base form builder</h3>
</div>

<div class="row">
<basic-form></basic-form>
</div>
</div>
17 changes: 17 additions & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {Headers, Http} from '@angular/Http';
import { FormsModule } from '@angular/forms';
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import {CountryComponent} from './custom.components/country.component/country.component';
import {ReportCardComponent}from './custom.components/report-card.component/report-card.component';
import {CountryService}from './custom.components/country.component/country.component.service';

describe('App', () => {
beforeEach(() => {
TestBed.configureTestingModule({ imports:[FormsModule], declarations: [AppComponent,CountryComponent,ReportCardComponent], providers:[Http,CountryService]});
});
it ('should work', () => {
let fixture = TestBed.createComponent(AppComponent);
expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent');
});
});
17 changes: 17 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component } from '@angular/core';





@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})

export class AppComponent {



}
3 changes: 3 additions & 0 deletions src/app/app.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface IAppConfig{
ServerUrl:string;
}
7 changes: 7 additions & 0 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Injectable} from '@angular/core';
@Injectable()

export class AppConfig{
public ServerUrl:string = "http://localhost:51478"

}
24 changes: 24 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import {HttpModule} from '@angular/Http';
import {WelcomeModule} from './modules/welcome.module';

import { AppComponent } from './app.component';
import {AppConfig} from './app.config'


@NgModule({
imports: [
BrowserModule,
HttpModule,
WelcomeModule
],
declarations: [
AppComponent
],
bootstrap: [ AppComponent ],
providers:[AppConfig],
schemas:[CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule { }
Loading

0 comments on commit 2bca0a2

Please sign in to comment.