-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): update to rc.5 and use ng2-webpack-config (#268)
* switch to ng-webpack-config * upgrade angular * create module, update component to rc5 * use last ng2-bootstrap and angular version, import tabsmodule * fix travis conf * add custom-typings * fix webpack config to parse md
- Loading branch information
Showing
32 changed files
with
401 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
var pkg = require('./package.json'); | ||
|
||
module.exports = { | ||
// metadata | ||
title: pkg.description, | ||
baseUrl: '/', | ||
// root folder name | ||
src: 'demo', | ||
dist: 'demo-build', | ||
htmlIndexes: ['index.html'], | ||
// karma bundle src | ||
spec: './spec-bundle.js', | ||
// webpack entry | ||
entry: { | ||
polyfills: './demo/polyfills.ts', | ||
vendor: './demo/vendor.ts', | ||
main: './demo/index.ts' | ||
}, | ||
commonChunks: { | ||
name: ['polyfills', 'vendor'].reverse() | ||
}, | ||
// webpack alias | ||
alias: {}, | ||
copy: [ | ||
{from: 'demo/favicon.ico', to: 'favicon.ico'}, | ||
{from: 'demo/assets', to: 'assets'} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ typings | |
|
||
# testing | ||
karma.conf.js | ||
test.bundle.js | ||
spec-bundle.js | ||
coverage | ||
|
||
# demo build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import {NgTableComponent} from './table/ng-table.component'; | ||
import {NgTableFilteringDirective} from './table/ng-table-filtering.directive'; | ||
import {NgTablePagingDirective} from './table/ng-table-paging.directive'; | ||
import {NgTableSortingDirective} from './table/ng-table-sorting.directive'; | ||
import { NgTableComponent } from './table/ng-table.component'; | ||
import { NgTableFilteringDirective } from './table/ng-table-filtering.directive'; | ||
import { NgTablePagingDirective } from './table/ng-table-paging.directive'; | ||
import { NgTableSortingDirective } from './table/ng-table-sorting.directive'; | ||
export const NG_TABLE_DIRECTIVES = [NgTableComponent, NgTableFilteringDirective, NgTablePagingDirective, NgTableSortingDirective]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { NgTableComponent } from './table/ng-table.component'; | ||
import { NgTableFilteringDirective } from './table/ng-table-filtering.directive'; | ||
import { NgTablePagingDirective } from './table/ng-table-paging.directive'; | ||
import { NgTableSortingDirective } from './table/ng-table-sorting.directive'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule], | ||
declarations: [NgTableComponent, NgTableFilteringDirective, NgTablePagingDirective, NgTableSortingDirective], | ||
exports: [NgTableComponent, NgTableFilteringDirective, NgTablePagingDirective, NgTableSortingDirective] | ||
}) | ||
export class Ng2TableModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
import {it, expect, describe, inject, addProviders} from '@angular/core/testing'; | ||
import {ComponentFixture} from '@angular/compiler/testing'; | ||
import {NgTableComponent} from './ng-table.component'; | ||
import { Component } from '@angular/core'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { Ng2TableModule } from '../ng-table-module'; | ||
|
||
const html = ``; | ||
|
||
describe('Component: ng2-table', () => { | ||
let fixture:ComponentFixture<any>; | ||
let context:TestTableComponent; | ||
let element:any; | ||
let clean:any; | ||
|
||
describe('Directive: FileSelectDirective', () => { | ||
beforeEach(() => { | ||
addProviders([NgTableComponent]); | ||
TestBed.configureTestingModule({ | ||
declarations: [TestTableComponent], | ||
imports: [Ng2TableModule] | ||
}); | ||
TestBed.overrideComponent(TestTableComponent, {set: {template: html}}); | ||
fixture = TestBed.createComponent(TestTableComponent); | ||
context = fixture.componentInstance; | ||
element = fixture.nativeElement.querySelector('#c1'); | ||
clean = fixture.nativeElement.querySelector('#c2'); | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should be true', () => { | ||
expect(true).toBe(true); | ||
}); | ||
it('should be fine', inject([NgTableComponent], (fixture:ComponentFixture<NgTableComponent>) => { | ||
expect(fixture).not.toBeNull(); | ||
})); | ||
}); | ||
|
||
@Component({ | ||
selector: 'table-test', | ||
template: '' | ||
}) | ||
|
||
class TestTableComponent { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<br> | ||
<section id="{{name.toLowerCase()}}"> | ||
<div class="row"><h1>{{name}}<small>(<a href="{{src}}">src</a>)</small></h1></div> | ||
|
||
<hr> | ||
|
||
<div class="row"><div class="col-md-12" [innerHTML]="titleDoc"></div></div> | ||
|
||
<div class="row"> | ||
<h2>Example</h2> | ||
<div class="card card-block panel panel-default panel-body"> | ||
<table-demo></table-demo> | ||
</div> | ||
</div> | ||
|
||
<br> | ||
|
||
<div class="row"> | ||
<tabset> | ||
<tab heading="Markup"> | ||
<div class="card card-block panel panel-default panel-body"> | ||
<pre class="language-html"><code class="language-html" [innerHTML]="html"></code></pre> | ||
</div> | ||
</tab> | ||
<tab heading="TypeScript"> | ||
<div class="card card-block panel panel-default panel-body"> | ||
<pre class="language-typescript"><code class="language-typescript" [innerHTML]="ts"></code></pre> | ||
</div> | ||
</tab> | ||
</tabset> | ||
</div> | ||
|
||
<br> | ||
|
||
<div class="row"> | ||
<h2>API</h2> | ||
<div class="card card-block panel panel-default panel-body" [innerHTML]="doc"></div> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare const ENV:string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
let gettingStarted = require('./getting-started.md'); | ||
|
||
@Component({ | ||
selector: 'app', | ||
template: ` | ||
<main class="bd-pageheader"> | ||
<div class="container"> | ||
<h1>ng2-table</h1> | ||
<p>Native Angular2 directives for Table</p> | ||
<a class="btn btn-primary" href="https://github.com/valor-software/ng2-table">View on GitHub</a> | ||
<div class="row"> | ||
<div class="col-lg-1"><iframe src="https://ghbtns.com/github-btn.html?user=valor-software&repo=ng2-table&type=star&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe></div> | ||
<div class="col-lg-1"><iframe src="https://ghbtns.com/github-btn.html?user=valor-software&repo=ng2-table&type=fork&count=true" frameborder="0" scrolling="0" width="170px" height="20px"></iframe></div> | ||
</div> | ||
</div> | ||
</main> | ||
<div class="container"> | ||
<section id="getting-started">${gettingStarted}</section> | ||
<table-section class="col-md-12"></table-section> | ||
</div> | ||
<footer class="footer"> | ||
<div class="container"> | ||
<p class="text-muted text-center"><a href="https://github.com/valor-software/ng2-table">ng2-table</a> is maintained by <a href="https://github.com/valor-software">valor-software</a>.</p> | ||
</div> | ||
</footer> | ||
` | ||
}) | ||
export class DemoComponent { | ||
} |
Oops, something went wrong.