chore(build): ng2 style guide applied,
- build process updated - systemjs bundler added BREAKING CHANGES: - directives and selectors renamed to ng2FileSelect and ng2FileDrop
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
/// <reference path="../../tsd.d.ts" />
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
import {CORE_DIRECTIVES} from '@angular/common';
|
||||
|
||||
import {TAB_DIRECTIVES} from 'ng2-bootstrap/ng2-bootstrap';
|
||||
import {SimpleDemo} from './file-upload/simple-demo';
|
||||
import {SimpleDemoComponent} from './file-upload/simple-demo';
|
||||
|
||||
let name = 'File Upload';
|
||||
let doc = require('../../components/file-upload/readme.md');
|
||||
@@ -19,7 +17,7 @@ let tabDesc:Array<any> = [
|
||||
];
|
||||
|
||||
let tabsContent:string = ``;
|
||||
tabDesc.forEach(desc => {
|
||||
tabDesc.forEach((desc:any) => {
|
||||
tabsContent += `
|
||||
<tab heading="${desc.heading}" (select)="select($event)">
|
||||
<div class="card card-block panel panel-default panel-body">
|
||||
@@ -70,12 +68,12 @@ tabDesc.forEach(desc => {
|
||||
</div>
|
||||
</section>
|
||||
`,
|
||||
directives: [SimpleDemo, TAB_DIRECTIVES, CORE_DIRECTIVES]
|
||||
directives: [SimpleDemoComponent, TAB_DIRECTIVES, CORE_DIRECTIVES]
|
||||
})
|
||||
export class FileUploadSection {
|
||||
private currentHeading:string = 'Simple';
|
||||
export class FileUploadSectionComponent {
|
||||
public currentHeading:string = 'Simple';
|
||||
|
||||
private select(e:any) {
|
||||
public select(e:any):void {
|
||||
if (e.heading) {
|
||||
this.currentHeading = e.heading;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*eslint-disable*/
|
||||
var express = require('express');
|
||||
var multer = require('multer');
|
||||
var fs = require('fs');
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<h3>Select files</h3>
|
||||
|
||||
<div ng2-file-drop
|
||||
<div ng2FileDrop
|
||||
[ngClass]="{'nv-file-over': hasBaseDropZoneOver}"
|
||||
(fileOver)="fileOverBase($event)"
|
||||
[uploader]="uploader"
|
||||
@@ -28,7 +28,7 @@
|
||||
Base drop zone
|
||||
</div>
|
||||
|
||||
<div ng2-file-drop
|
||||
<div ng2FileDrop
|
||||
[ngClass]="{'another-file-over-class': hasAnotherDropZoneOver}"
|
||||
(fileOver)="fileOverAnother($event)"
|
||||
[uploader]="uploader"
|
||||
@@ -37,10 +37,10 @@
|
||||
</div>
|
||||
|
||||
Multiple
|
||||
<input type="file" ng2-file-select [uploader]="uploader" multiple /><br/>
|
||||
<input type="file" ng2FileSelect [uploader]="uploader" multiple /><br/>
|
||||
|
||||
Single
|
||||
<input type="file" ng2-file-select [uploader]="uploader" />
|
||||
<input type="file" ng2FileSelect [uploader]="uploader" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-9" style="margin-bottom: 40px">
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../../../tsd.d.ts" />
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
import {CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgStyle} from '@angular/common';
|
||||
import {FILE_UPLOAD_DIRECTIVES, FileUploader} from '../../../ng2-file-upload';
|
||||
@@ -15,16 +13,16 @@ const URL = 'https://evening-anchorage-3159.herokuapp.com/api/';
|
||||
template: template,
|
||||
directives: [FILE_UPLOAD_DIRECTIVES, NgClass, NgStyle, CORE_DIRECTIVES, FORM_DIRECTIVES]
|
||||
})
|
||||
export class SimpleDemo {
|
||||
private uploader:FileUploader = new FileUploader({url: URL});
|
||||
private hasBaseDropZoneOver:boolean = false;
|
||||
private hasAnotherDropZoneOver:boolean = false;
|
||||
export class SimpleDemoComponent {
|
||||
public uploader:FileUploader = new FileUploader({url: URL});
|
||||
public hasBaseDropZoneOver:boolean = false;
|
||||
public hasAnotherDropZoneOver:boolean = false;
|
||||
|
||||
private fileOverBase(e:any) {
|
||||
public fileOverBase(e:any):void {
|
||||
this.hasBaseDropZoneOver = e;
|
||||
}
|
||||
|
||||
private fileOverAnother(e:any) {
|
||||
public fileOverAnother(e:any):void {
|
||||
this.hasAnotherDropZoneOver = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,11 +34,5 @@
|
||||
Loading...
|
||||
</app>
|
||||
|
||||
<!-- Angular2 files -->
|
||||
<script src="/build/angular2.js"></script>
|
||||
<!-- Angular2 file upload script -->
|
||||
<script src="/build/angular2-file-upload.js"></script>
|
||||
<!-- App script -->
|
||||
<script src="/build/angular2-file-upload-demo.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/// <reference path="../tsd.d.ts" />
|
||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {Component} from '@angular/core';
|
||||
import {NgClass} from '@angular/common';
|
||||
|
||||
import {FileUploadSection} from './components/file-upload-section';
|
||||
import {FileUploadSectionComponent} from './components/file-upload-section';
|
||||
|
||||
let gettingStarted = require('./getting-started.md');
|
||||
|
||||
@@ -36,10 +35,10 @@ let gettingStarted = require('./getting-started.md');
|
||||
`,
|
||||
directives: [
|
||||
NgClass,
|
||||
FileUploadSection
|
||||
FileUploadSectionComponent
|
||||
]
|
||||
})
|
||||
export class Demo {
|
||||
export class DemoComponent {
|
||||
}
|
||||
|
||||
bootstrap(Demo);
|
||||
bootstrap(DemoComponent);
|
||||
|
||||
Reference in New Issue
Block a user