Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
Updated for Angular2 beta 17
Breaking change: DynamicComponentLoader.loadNextToLocation now takes a
ViewContainerRef instead of an ElementRef
  • Loading branch information
Alberplz committed May 1, 2016
1 parent 7f1cba6 commit acc8e97
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
13 changes: 8 additions & 5 deletions app/color-picker/color-picker.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {Component, DynamicComponentLoader, Directive, Input, Output, ElementRef, EventEmitter, OnInit} from 'angular2/core';
import {Component, DynamicComponentLoader, Directive, Input, Output, ViewContainerRef, ElementRef, EventEmitter, OnInit} from 'angular2/core';
import {ColorPickerService} from './color-picker.service';
import {Rgba, Hsla, Hsva, SliderPosition, SliderDimension} from './classes';

const styleUrls: string[] = ['app/color-picker/color-picker.css'];
const templateUrl: string = 'app/color-picker/color-picker.html';

@Directive({
selector: '[colorPicker]',
host: {
Expand All @@ -23,7 +26,7 @@ export class ColorPickerDirective implements OnInit {
private dialog: any;
private created: boolean;

constructor(private dcl: DynamicComponentLoader, private el: ElementRef, private service: ColorPickerService) {
constructor(private dcl: DynamicComponentLoader, private vcRef: ViewContainerRef, private el: ElementRef, private service: ColorPickerService) {
this.created = false;
}

Expand All @@ -37,7 +40,7 @@ export class ColorPickerDirective implements OnInit {
onClick() {
if (!this.created) {
this.created = true;
this.dcl.loadNextToLocation(DialogComponent, this.el)
this.dcl.loadNextToLocation(DialogComponent, this.vcRef)
.then((res) => {
res.instance.setDialog(this, this.el, this.colorPicker, this.cpPosition, this.cpPositionOffset,
this.cpPositionRelativeToArrow, this.cpOutputFormat, this.cpCancelButton, this.cpCancelButtonClass, this.cpCancelButtonText, this.cpHeight);
Expand Down Expand Up @@ -148,8 +151,8 @@ export class SliderDirective {

@Component({
selector: 'color-picker',
templateUrl: 'app/color-picker/color-picker.html',
styleUrls: ['app/color-picker/color-picker.css'],
templateUrl: templateUrl,
styleUrls: styleUrls,
directives: [SliderDirective, TextDirective]
})
export class DialogComponent implements OnInit {
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-color-picker",
"version": "1.0.2",
"version": "1.0.3",
"authors": [
"Alberto Pujante <[email protected]>"
],
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<!-- IE required polyfills, in this exact order -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.26/system-polyfills.js"></script>
<script src="https://npmcdn.com/[email protected].15/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="https://npmcdn.com/[email protected].17/es6/dev/src/testing/shims_for_IE.js"></script>

<script src="https://code.angularjs.org/2.0.0-beta.15/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/tools/system.js"></script>
<script src="https://npmcdn.com/[email protected]/lib/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.15/angular2.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.17/angular2.dev.js"></script>

<!-- IE required polyfills, in this exact order -->
<!--<script src="node_modules/es6-shim/es6-shim.min.js"></script>
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-color-picker",
"version": "1.0.2",
"version": "1.0.3",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
Expand All @@ -11,17 +11,17 @@
},
"license": "MIT",
"dependencies": {
"angular2": "2.0.0-beta.15",
"angular2": "2.0.0-beta.17",
"systemjs": "0.19.26",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.10"
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^0.8.1"
}
}
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"compilerOptions": {
"target": "es5",
"module": "system",
Expand All @@ -15,5 +14,4 @@
"typings/main",
"typings/main.d.ts"
]

}
4 changes: 2 additions & 2 deletions typings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438"
}
}

0 comments on commit acc8e97

Please sign in to comment.