Skip to content

Commit

Permalink
fix(Polyline): fix private member state
Browse files Browse the repository at this point in the history
  • Loading branch information
sebholstein committed Oct 23, 2016
1 parent 648856d commit 758d3e0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/core/directives/google-map-polyline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ export class SebmGoogleMapPolyline implements OnDestroy, OnChanges, AfterContent
*/
lineRightClick: EventEmitter<PolyMouseEvent> = new EventEmitter<PolyMouseEvent>();

@ContentChildren(SebmGoogleMapPolylinePoint)
private _points: QueryList<SebmGoogleMapPolylinePoint>;
/**
* @internal
*/
@ContentChildren(SebmGoogleMapPolylinePoint) points: QueryList<SebmGoogleMapPolylinePoint>;

private static _polylineOptionsAttributes: Array<string> = [
'draggable', 'editable', 'visible', 'geodesic', 'strokeColor', 'strokeOpacity', 'strokeWeight',
Expand All @@ -170,8 +172,8 @@ export class SebmGoogleMapPolyline implements OnDestroy, OnChanges, AfterContent

/** @internal */
ngAfterContentInit() {
if (this._points.length) {
this._points.forEach((point: SebmGoogleMapPolylinePoint) => {
if (this.points.length) {
this.points.forEach((point: SebmGoogleMapPolylinePoint) => {
const s = point.positionChanged.subscribe(
() => { this._polylineManager.updatePolylinePoints(this); });
this._subscriptions.push(s);
Expand All @@ -180,8 +182,7 @@ export class SebmGoogleMapPolyline implements OnDestroy, OnChanges, AfterContent
if (!this._polylineAddedToManager) {
this._init();
}
const s =
this._points.changes.subscribe(() => this._polylineManager.updatePolylinePoints(this));
const s = this.points.changes.subscribe(() => this._polylineManager.updatePolylinePoints(this));
this._subscriptions.push(s);
this._polylineManager.updatePolylinePoints(this);
}
Expand Down Expand Up @@ -227,8 +228,8 @@ export class SebmGoogleMapPolyline implements OnDestroy, OnChanges, AfterContent

/** @internal */
_getPoints(): Array<SebmGoogleMapPolylinePoint> {
if (this._points) {
return this._points.toArray();
if (this.points) {
return this.points.toArray();
}
return [];
}
Expand Down

0 comments on commit 758d3e0

Please sign in to comment.