Skip to content

Commit

Permalink
Updated: angular2 0.42.0 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
buchslava committed Oct 15, 2015
1 parent d993060 commit a2f774a
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 84 deletions.
1 change: 0 additions & 1 deletion components/file-upload/file-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {FileLikeObject} from './file-like-object';
import {FileUploader} from './file-uploader';
import Form = ng.Form;

export class FileItem {
public file:FileLikeObject;
Expand Down
2 changes: 0 additions & 2 deletions components/file-upload/file-select.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference path="../../tsd.d.ts" />

import {
Component, View, OnInit, OnDestroy, OnChanges,
Directive, EventEmitter, ElementRef, Renderer,
Expand Down
5 changes: 0 additions & 5 deletions components/module.ts

This file was deleted.

5 changes: 4 additions & 1 deletion demo/components/file-upload/simple-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {FileUploader} from '../../../components/file-upload/file-uploader';
// webpack html imports
let template = require('./simple-demo.html');

// const URL = '/api/';
const URL = 'https://evening-anchorage-3159.herokuapp.com/api/';

@Component({
selector: 'simple-demo'
})
Expand All @@ -19,7 +22,7 @@ let template = require('./simple-demo.html');
directives: [FileSelect, FileDrop, NgClass, NgStyle, CORE_DIRECTIVES, FORM_DIRECTIVES]
})
export class SimpleDemo {
private uploader:FileUploader = new FileUploader({url: '/api/'});
private uploader:FileUploader = new FileUploader({url: URL});
private hasBaseDropZoneOver:boolean = false;
private hasAnotherDropZoneOver:boolean = false;

Expand Down
26 changes: 26 additions & 0 deletions es6-object.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
interface ObjectConstructor {
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
* @param target The target object to copy to.
* @param sources One or more source objects to copy properties from.
*/
assign(target: any, ...sources: any[]): any;

/**
* Returns true if the values are the same value, false otherwise.
* @param value1 The first value.
* @param value2 The second value.
*/
is(value1: any, value2: any): boolean;

/**
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
* @param o The object to change its prototype.
* @param proto The value of the new prototype or null.
* @remarks Requires `__proto__` support.
*/
setPrototypeOf(o: any, proto: any): any;
}

declare function require(path:string): any;
29 changes: 0 additions & 29 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,12 @@ gulp.paths = {

require('require-dir')('./gulp-tasks');

var typescript = require('gulp-tsc');
var options = require('./tsconfig.json').compilerOptions;
options.emitError = false;

var o = {
target: 'es5',
module: 'commonjs',
outDir: 'dist',
sourceRoot: 'dist',
mapRoot: 'dist',
keepTree: true,
declaration: true,
noEmitOnError: true,
emitError: false,
sourceMap: true,
removeComments: true,
noResolve: false,
suppressImplicitAnyIndexErrors: true,
safe: false,
emitDecoratorMetadata: true,
experimentalDecorators: true
};

var clean = require('gulp-clean');
gulp.task('clean', function () {
return gulp.src('dist', {read: false})
.pipe(clean());
});

gulp.task('compile', ['clean'], function () {
gulp.src(['components/**/*.ts'])
.pipe(typescript(o))
.pipe(gulp.dest(options.outDir));
});

gulp.task('default', function () {
gulp.start('lint');
});
61 changes: 27 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
{
"name": "ng2-file-upload",
"version": "0.40.0",
"version": "0.42.0",
"description": "angular2 file upload directives",
"scripts": {
"deploy": "NODE_ENV=production webpack -p --progress --color --optimize-minimize --optimize-dedupe --optimize-occurence-order",
"prepublish": "gulp compile",
"prepublish": "gulp clean && tsc",
"prestart": "npm install",
"server": "webpack-dev-server --hot --inline --colors --display-error-details --display-cached",
"start": "npm run server",
"test": "gulp lint"
},
"main": "dist/index.js",
"typescript": {
"definition": [
"dist/module.d.ts",
"typings/es6-object.d.ts"
]
},
"typings": "dist/index.d.ts",
"files": [
"dist",
"components",
"typings",
"tsd.d.ts"
"components"
],
"keywords": [
"angular2",
Expand All @@ -40,36 +33,36 @@
},
"homepage": "https://github.com/valor-software/ng2-file-upload#readme",
"dependencies": {
"angular2": "^2.0.0-alpha.40",
"angular2": "^2.0.0-alpha.42",
"ng2-bootstrap": "^0.40.0",
"reflect-metadata": "0.1.2",
"ts-loader": "0.5.6",
"zone.js": "0.5.8"
},
"devDependencies": {
"bootstrap": "^3.3.5",
"clean-webpack-plugin": "^0.1.3",
"compression-webpack-plugin": "^0.2.0",
"eslint": "^1.1.0",
"exports-loader": "^0.6.2",
"file-loader": "^0.8.4",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-eslint": "^1.0.0",
"gulp-size": "^2.0.0",
"gulp-tsc": "^1.1.1",
"gulp-tslint": "^3.1.2",
"html-loader": "^0.3.0",
"markdown-loader": "^0.1.7",
"marked": "^0.3.5",
"moment": "^2.10.6",
"pre-commit": "^1.1.1",
"bootstrap": "3.3.5",
"clean-webpack-plugin": "0.1.3",
"compression-webpack-plugin": "0.2.0",
"eslint": "1.6.0",
"exports-loader": "0.6.2",
"file-loader": "0.8.4",
"gulp": "3.9.0",
"gulp-clean": "0.3.1",
"gulp-eslint": "1.0.0",
"gulp-size": "2.0.0",
"gulp-tsc": "1.1.1",
"gulp-tslint": "3.3.1",
"html-loader": "0.3.0",
"markdown-loader": "0.1.7",
"marked": "0.3.5",
"moment": "2.10.6",
"pre-commit": "1.1.1",
"prismjs": "valorkin/prism",
"prismjs-loader": "0.0.2",
"raw-loader": "^0.5.1",
"require-dir": "^0.3.0",
"typescript": "^1.6.2",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.0"
"raw-loader": "0.5.1",
"require-dir": "0.3.0",
"typescript": "1.6.2",
"webpack": "1.12.2",
"webpack-dev-server": "1.12.0"
}
}
13 changes: 3 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,10 @@
"noEmitOnError": false,
"noImplicitAny": false
},
"filesGlob": [
"!./node_modules/**/*.ts"
"exclude": [
"node_modules"
],
"files": [
"./tsd.d.ts",
"./components/file-upload/file-select.ts",
"./components/file-upload/file-item.ts",
"./components/file-upload/file-like-object.ts",
"./components/file-upload/file-drop.ts",
"./components/file-upload/file-uploader.ts",
"./components/index.ts",
"./components/module.ts"
"./components/index.ts"
]
}
3 changes: 1 addition & 2 deletions tsd.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/// <reference path="typings/tsd.d.ts"/>
/// <reference path="node_modules/angular2/bundles/typings/angular2/angular2.d.ts" />
/// <reference path="es6-object.d.ts"/>

0 comments on commit a2f774a

Please sign in to comment.