From 511f1f4731bd4f58328855d337fa6c1ca0b315b9 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Wed, 1 Apr 2020 10:05:44 +0200 Subject: [PATCH] Add @Directive attributes --- .../feature-list-feature.component.ts | 57 +++++++-------- .../feature-list/feature-list.component.ts | 3 +- .../item-list-item.component.ts | 72 ++++++++++--------- .../item-list/item-list.component.ts | 3 +- .../selected-item/selected-item.component.ts | 3 +- 5 files changed, 72 insertions(+), 66 deletions(-) diff --git a/projects/common-map/src/fm-map/components/feature-list-feature/feature-list-feature.component.ts b/projects/common-map/src/fm-map/components/feature-list-feature/feature-list-feature.component.ts index a681da6..8a37cdb 100644 --- a/projects/common-map/src/fm-map/components/feature-list-feature/feature-list-feature.component.ts +++ b/projects/common-map/src/fm-map/components/feature-list-feature/feature-list-feature.component.ts @@ -1,28 +1,29 @@ -import { Component, Input, Injectable} from '@angular/core'; -import { Feature } from 'ol'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common'; - - - -@Injectable() -export abstract class AbstractFeatureListFeatureComponent { - @Input() feature: Feature - - constructor(public store: Store, public itemTypeService: ItemTypeService,public config:AppConfig) { - } -} - -@Injectable() -@Component({ - selector: 'fm-map-feature-list-feature', - templateUrl: './feature-list-feature.component.html', - styleUrls: ['./feature-list-feature.component.scss'] -}) -export class FeatureListFeatureComponent extends AbstractFeatureListFeatureComponent { - - constructor(store: Store, itemTypeService: ItemTypeService, config:AppConfig) { - super(store, itemTypeService,config); - } -} +import { Component, Input, Injectable,Directive} from '@angular/core'; +import { Feature } from 'ol'; +import { Store } from '@ngrx/store'; +import * as mapReducers from '../../reducers/map.reducer'; +import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common'; + + + +@Injectable() +@Directive() +export abstract class AbstractFeatureListFeatureComponent { + @Input() feature: Feature + + constructor(public store: Store, public itemTypeService: ItemTypeService,public config:AppConfig) { + } +} + +@Injectable() +@Component({ + selector: 'fm-map-feature-list-feature', + templateUrl: './feature-list-feature.component.html', + styleUrls: ['./feature-list-feature.component.scss'] +}) +export class FeatureListFeatureComponent extends AbstractFeatureListFeatureComponent { + + constructor(store: Store, itemTypeService: ItemTypeService, config:AppConfig) { + super(store, itemTypeService,config); + } +} diff --git a/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts b/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts index 119866c..791a9cd 100644 --- a/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts +++ b/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Injectable } from '@angular/core'; +import { Component, Input, Injectable,Directive } from '@angular/core'; import { Location } from '@angular/common'; import { Feature } from 'ol'; import { Store } from '@ngrx/store'; @@ -12,6 +12,7 @@ import { IQueryState } from '@farmmaps/common'; @Injectable() +@Directive() export abstract class AbstractFeatureListComponent { @Input() features: Array; @Input() queryState: IQueryState; diff --git a/projects/common-map/src/fm-map/components/item-list-item/item-list-item.component.ts b/projects/common-map/src/fm-map/components/item-list-item/item-list-item.component.ts index 3271dcb..8450dcf 100644 --- a/projects/common-map/src/fm-map/components/item-list-item/item-list-item.component.ts +++ b/projects/common-map/src/fm-map/components/item-list-item/item-list-item.component.ts @@ -1,35 +1,37 @@ -import { Component, Input, Injectable} from '@angular/core'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers,ItemTypeService,IListItem } from '@farmmaps/common'; - - - -@Injectable() -export abstract class AbstractItemListItemComponent { - @Input() item: IListItem - - constructor(public store: Store, public itemTypeService: ItemTypeService) { - } -} - -@Injectable() -export abstract class AbstractItemWidgetComponent { - @Input() item: IListItem - - constructor(public store: Store, public itemTypeService: ItemTypeService) { - } -} - -@Injectable() -@Component({ - selector: 'fm-map-item-list-item', - templateUrl: './item-list-item.component.html', - styleUrls: ['./item-list-item.component.scss'] -}) -export class ItemListItemComponent extends AbstractItemListItemComponent { - - constructor(store: Store, itemTypeService: ItemTypeService) { - super(store, itemTypeService); - } -} +import { Component, Input, Injectable,Directive} from '@angular/core'; +import { Store } from '@ngrx/store'; +import * as mapReducers from '../../reducers/map.reducer'; +import { commonReducers,ItemTypeService,IListItem } from '@farmmaps/common'; + + + +@Injectable() +@Directive() +export abstract class AbstractItemListItemComponent { + @Input() item: IListItem + + constructor(public store: Store, public itemTypeService: ItemTypeService) { + } +} + +@Injectable() +@Directive() +export abstract class AbstractItemWidgetComponent { + @Input() item: IListItem + + constructor(public store: Store, public itemTypeService: ItemTypeService) { + } +} + +@Injectable() +@Component({ + selector: 'fm-map-item-list-item', + templateUrl: './item-list-item.component.html', + styleUrls: ['./item-list-item.component.scss'] +}) +export class ItemListItemComponent extends AbstractItemListItemComponent { + + constructor(store: Store, itemTypeService: ItemTypeService) { + super(store, itemTypeService); + } +} diff --git a/projects/common-map/src/fm-map/components/item-list/item-list.component.ts b/projects/common-map/src/fm-map/components/item-list/item-list.component.ts index f50ba7a..d154a21 100644 --- a/projects/common-map/src/fm-map/components/item-list/item-list.component.ts +++ b/projects/common-map/src/fm-map/components/item-list/item-list.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Injectable } from '@angular/core'; +import { Component, Input, Injectable, Directive } from '@angular/core'; import { Location } from '@angular/common'; import { Store } from '@ngrx/store'; import * as mapReducers from '../../reducers/map.reducer'; @@ -8,6 +8,7 @@ import { tassign } from 'tassign'; @Injectable() +@Directive() export abstract class AbstractItemListComponent { @Input() items: Array constructor(public store: Store, public itemTypeService: ItemTypeService, private location: Location) { diff --git a/projects/common-map/src/fm-map/components/selected-item/selected-item.component.ts b/projects/common-map/src/fm-map/components/selected-item/selected-item.component.ts index 5cc1013..da374b3 100644 --- a/projects/common-map/src/fm-map/components/selected-item/selected-item.component.ts +++ b/projects/common-map/src/fm-map/components/selected-item/selected-item.component.ts @@ -1,4 +1,4 @@ -import {Component, Injectable, Input} from '@angular/core'; +import {Component, Injectable, Input, Directive} from '@angular/core'; import {Location} from '@angular/common'; import {Store} from '@ngrx/store'; import * as mapReducers from '../../reducers/map.reducer'; @@ -9,6 +9,7 @@ import { IItemLayer } from '../../models/item.layer'; @Injectable() +@Directive() export abstract class AbstractSelectedItemComponent { @Input() item: IItem @Input() itemLayer: IItemLayer;