Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Update NgGrid to angular2 release candidate. Closes #75
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMorton committed May 4, 2016
1 parent 9c0c131 commit b6cb6ac
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ The `NgGrid` and `NgGridItem` can be configured by binding directly to the direc

```html
<div [ngGrid]="{'resizeable': false, 'margins': [5, 10]}">
<div *ngFor="#box of boxes" [(ngGridItem)]="box.config">
<div *ngFor="let box of boxes" [(ngGridItem)]="box.config">
<div class="title">{{box.title}}</div>
<p>{{box.text}}</p>
</div>
Expand Down
29 changes: 10 additions & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,11 @@ var PATHS = {
test: 'test/*.ts',
typings: 'src/*.d.ts'
},
libs: [
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/bootstrap/dist/css/bootstrap-theme.min.css',
'node_modules/angular2/bundles/angular2.js',
'node_modules/angular2/bundles/angular2-polyfills.min.js',
'node_modules/systemjs/dist/system.js',
'node_modules/systemjs/dist/system-polyfills.js',
'node_modules/es6-shim/es6-shim.min.js',
'node_modules/reflect-metadata/Reflect.js',
'node_modules/rxjs/bundles/Rx.min.js'
],
rx: 'node_modules/rxjs/**/*.js',
typings: [
'node_modules/angular2/typings/**/*.d.ts',
'typings/browser.d.ts',
],
testTypings: [
'node_modules/angular2/typings/**/*.d.ts',
'typings/browser.d.ts',
'dist/*.d.ts'
],
};
Expand Down Expand Up @@ -107,15 +95,18 @@ gulp.task('css', function () {
return gulp.src(PATHS.src.css).pipe(gulp.dest('dist'));
});

gulp.task('rx', function () {
return gulp.src(PATHS.rx, {base: 'node_modules/'}).pipe(gulp.dest('dist/'));
gulp.task('libs', function () {
return merge([
gulp.src('node_modules/').pipe(symlink('dist/node_modules')),
gulp.src('bower_components/').pipe(symlink('dist/bower_components'))
]);
});

gulp.task('libs', ['rx'], function () {
return gulp.src(PATHS.libs).pipe(gulp.dest('dist/lib'));
gulp.task('clean', function(done) {
return del(['dist'], done);
});

gulp.task('build', function() {
gulp.task('build', ['clean'], function() {
return gulp.start('libs', 'html', 'css', 'ts');
});

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
"dist/NgGrid*"
],
"peerDependencies": {
"angular2": "^2.0.0-beta.16"
"@angular/core": "^2.0.0-rc.0"
},
"devDependencies": {
"angular2": "^2.0.0-beta.16",
"@angular/common": "^2.0.0-rc.0",
"@angular/core": "^2.0.0-rc.0",
"@angular/platform-browser-dynamic": "^2.0.0-rc.0",
"del": "^1.2.1",
"es6-promise": "^3.0.2",
"es6-shim": "^0.35.0",
Expand All @@ -65,7 +67,7 @@
"rxjs": "^5.0.0-beta.6",
"systemjs": "^0.19.4",
"typescript": "^1.6.2",
"zone.js": "^0.6.6"
"zone.js": "^0.6.12"
},
"dependencies": {}
}
2 changes: 1 addition & 1 deletion src/NgGrid.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElementRef, Renderer, EventEmitter, DynamicComponentLoader, KeyValueDiffers, OnInit, OnDestroy, DoCheck, ViewContainerRef } from 'angular2/core';
import { ElementRef, Renderer, EventEmitter, DynamicComponentLoader, KeyValueDiffers, OnInit, OnDestroy, DoCheck, ViewContainerRef } from '@angular/core';
export interface NgGridConfig {
margins?: number[];
draggable?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/NgGrid.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Directive, ElementRef, Renderer, EventEmitter, DynamicComponentLoader, Host, ViewEncapsulation, Type, ComponentRef, KeyValueDiffer, KeyValueDiffers, OnInit, OnDestroy, DoCheck, ViewContainerRef, Output } from 'angular2/core';
import { Component, Directive, ElementRef, Renderer, EventEmitter, DynamicComponentLoader, Host, ViewEncapsulation, Type, ComponentRef, KeyValueDiffer, KeyValueDiffers, OnInit, OnDestroy, DoCheck, ViewContainerRef, Output } from '@angular/core';

// Default config
export interface NgGridConfig {
Expand Down Expand Up @@ -82,7 +82,7 @@ export class NgGrid implements OnInit, DoCheck, OnDestroy {
private _setHeight: number = 250;
private _posOffset: { left: number, top: number } = null;
private _adding: boolean = false;
private _placeholderRef: ComponentRef = null;
private _placeholderRef: ComponentRef<NgGridPlaceholder> = null;
private _fixToGrid: boolean = false;
private _autoResize: boolean = false;
private _differ: KeyValueDiffer;
Expand Down
6 changes: 3 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ViewEncapsulation, enableProdMode } from 'angular2/core';
import { CORE_DIRECTIVES, FORM_DIRECTIVES } from 'angular2/common';
import { bootstrap } from 'angular2/platform/browser';
import { Component, ViewEncapsulation, enableProdMode } from '@angular/core';
import { CORE_DIRECTIVES, FORM_DIRECTIVES } from '@angular/common';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { NgGrid, NgGridConfig, NgGridItem, NgGridItemConfig, NgGridItemEvent } from "./NgGrid";

// Annotation section
Expand Down
25 changes: 16 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
<html>
<head>
<title>Angular 2 Grid Demo</title>
<link rel="stylesheet" href="lib/bootstrap.min.css" />
<script src="lib/es6-shim.min.js"></script>
<script src="lib/angular2-polyfills.min.js"></script>
<script src="lib/system.js"></script>
<script src="lib/Rx.min.js"></script>
<script src="lib/angular2.js"></script>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" />
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
</head>
<body>
<my-app></my-app>
Expand All @@ -16,9 +15,17 @@
System.config({
defaultJSExtensions: true,
packages: {
'angular2': {
defaultExtension: false
}
'@angular/common': { main: 'index.js', defaultExtension: 'js' },
'@angular/core': { main: 'index.js', defaultExtension: 'js' },
'@angular/platform-browser-dynamic': { main: 'index.js', defaultExtension: 'js' },
'@angular/platform-browser': { main: 'index.js', defaultExtension: 'js' },
'@angular/compiler': { main: 'index.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'app': { defaultExtension: 'js' }
},
map: {
'@angular': 'node_modules/@angular',
'rxjs': 'node_modules/rxjs'
}
});
System.import('app');
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
},
"exclude": [
"bower",
"node_modules"
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
12 changes: 0 additions & 12 deletions tsd.json

This file was deleted.

6 changes: 6 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438"
}
}

0 comments on commit b6cb6ac

Please sign in to comment.