Skip to content

Commit

Permalink
demo angular2-data-table
Browse files Browse the repository at this point in the history
  • Loading branch information
Caballerog committed Aug 18, 2016
1 parent ab5b76c commit 74af99d
Show file tree
Hide file tree
Showing 2,492 changed files with 234,343 additions and 0 deletions.
Binary file added demos/angular2-data-table/0.1.0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions demos/angular2-data-table/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ExampleInlineEditor

This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.10.

## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/route/class`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Deploying to Github Pages

Run `ng github-pages:deploy` to deploy to Github Pages.

## Further help

To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
23 changes: 23 additions & 0 deletions demos/angular2-data-table/angular-cli-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Angular-CLI build configuration
// This file lists all the node_modules files that will be used in a build
// Also see https://github.com/angular/angular-cli/wiki/3rd-party-libs

/* global require, module */

var Angular2App = require('angular-cli/lib/broccoli/angular2-app');

module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/**/*.+(js|js.map)',
'es6-shim/es6-shim.js',
'reflect-metadata/**/*.+(ts|js|js.map)',
'rxjs/**/*.+(js|js.map)',
'@angular/**/*.+(js|js.map)',
'angular2-data-table/**/*.js',
'ng2-inline-editor/dist/**/*.js'
]
});
};
32 changes: 32 additions & 0 deletions demos/angular2-data-table/angular-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"project": {
"version": "1.0.0-beta.10",
"name": "example-inline-editor"
},
"apps": [
{
"main": "src/main.ts",
"tsconfig": "src/tsconfig.json",
"mobile": false
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "config/protractor.conf.js"
}
},
"test": {
"karma": {
"config": "config/karma.conf.js"
}
},
"defaults": {
"prefix": "app",
"sourceDir": "src",
"styleExt": "css",
"prefixInterfaces": false,
"lazyRoutePrefix": "+"
}
}
3 changes: 3 additions & 0 deletions demos/angular2-data-table/config/environment.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: false
};
12 changes: 12 additions & 0 deletions demos/angular2-data-table/config/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Angular-CLI server configuration
// Unrelated to environment.dev|prod.ts

/* jshint node: true */

module.exports = function(environment) {
return {
environment: environment,
baseURL: '/',
locationType: 'auto'
};
};
3 changes: 3 additions & 0 deletions demos/angular2-data-table/config/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const environment = {
production: true
};
56 changes: 56 additions & 0 deletions demos/angular2-data-table/config/karma-test-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Test shim for Karma, needed to load files via SystemJS

/*global jasmine, __karma__, window*/
Error.stackTraceLimit = Infinity;
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;

__karma__.loaded = function () {
};

var distPath = '/base/dist/';
var appPaths = ['app']; //Add all valid source code folders here

function isJsFile(path) {
return path.slice(-3) == '.js';
}

function isSpecFile(path) {
return path.slice(-8) == '.spec.js';
}

function isAppFile(path) {
return isJsFile(path) && appPaths.some(function(appPath) {
var fullAppPath = distPath + appPath + '/';
return path.substr(0, fullAppPath.length) == fullAppPath;
});
}

var allSpecFiles = Object.keys(window.__karma__.files)
.filter(isSpecFile)
.filter(isAppFile);

// Load our SystemJS configuration.
System.config({
baseURL: distPath
});

System.import('system-config.js').then(function() {
// Load and configure the TestComponentBuilder.
return Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing')
]).then(function (providers) {
var testing = providers[0];
var testingBrowser = providers[1];

testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
});
}).then(function() {
// Finally, load all spec files.
// This will run the tests directly.
return Promise.all(
allSpecFiles.map(function (moduleName) {
return System.import(moduleName);
}));
}).then(__karma__.start, __karma__.error);
46 changes: 46 additions & 0 deletions demos/angular2-data-table/config/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '..',
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher')
],
customLaunchers: {
// chrome setup for travis CI using chromium
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
files: [
{ pattern: 'dist/vendor/es6-shim/es6-shim.js', included: true, watched: false },
{ pattern: 'dist/vendor/zone.js/dist/zone.js', included: true, watched: false },
{ pattern: 'dist/vendor/reflect-metadata/Reflect.js', included: true, watched: false },
{ pattern: 'dist/vendor/systemjs/dist/system-polyfills.js', included: true, watched: false },
{ pattern: 'dist/vendor/systemjs/dist/system.src.js', included: true, watched: false },
{ pattern: 'dist/vendor/zone.js/dist/async-test.js', included: true, watched: false },
{ pattern: 'dist/vendor/zone.js/dist/fake-async-test.js', included: true, watched: false },

{ pattern: 'config/karma-test-shim.js', included: true, watched: true },

// Distribution folder.
{ pattern: 'dist/**/*', included: false, watched: true }
],
exclude: [
// Vendor packages might include spec files. We don't want to use those.
'dist/vendor/**/*.spec.js'
],
preprocessors: {},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
32 changes: 32 additions & 0 deletions demos/angular2-data-table/config/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js

/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'../e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
useAllAngular2AppRoots: true,
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
Empty file.
Empty file.
36 changes: 36 additions & 0 deletions demos/angular2-data-table/dist/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<datatable class="material" [rows]="rows" [options]="options">


<datatable-column name="Name">
<template let-row="row">
<inline-editor type="text" [(ngModel)]="row['name']" (onSave)="saveEditable(row)"></inline-editor>

</template>
</datatable-column>
<datatable-column name="Gender">
<template let-row="row">
<inline-editor type="select"
[options]="editableSelectOptions" (onSave)="saveEditable(row)" [(ngModel)]="row['gender']"></inline-editor>

</template>
</datatable-column>
<datatable-column name="Age">
<template let-row="row">
<inline-editor type="number"
(onSave)="saveEditable(row)" [(ngModel)]="row['age']"></inline-editor>

</template>
</datatable-column>

<datatable-column name="Company">
<template let-row="row">
<inline-editor type="textarea"
(onSave)="saveEditable(row)" [(ngModel)]="row['company']"></inline-editor>

</template>
</datatable-column>




</datatable>
93 changes: 93 additions & 0 deletions demos/angular2-data-table/dist/app/app.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions demos/angular2-data-table/dist/app/app.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74af99d

Please sign in to comment.