Add @Directive attributes

This commit is contained in:
Willem Dantuma 2020-04-01 10:05:44 +02:00
parent a5a7e1ece1
commit 511f1f4731
5 changed files with 72 additions and 66 deletions

View File

@ -1,28 +1,29 @@
import { Component, Input, Injectable} from '@angular/core'; import { Component, Input, Injectable,Directive} from '@angular/core';
import { Feature } from 'ol'; import { Feature } from 'ol';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer'; import * as mapReducers from '../../reducers/map.reducer';
import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common'; import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common';
@Injectable() @Injectable()
export abstract class AbstractFeatureListFeatureComponent { @Directive()
@Input() feature: Feature export abstract class AbstractFeatureListFeatureComponent {
@Input() feature: Feature
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService,public config:AppConfig) {
} constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService,public config:AppConfig) {
} }
}
@Injectable()
@Component({ @Injectable()
selector: 'fm-map-feature-list-feature', @Component({
templateUrl: './feature-list-feature.component.html', selector: 'fm-map-feature-list-feature',
styleUrls: ['./feature-list-feature.component.scss'] templateUrl: './feature-list-feature.component.html',
}) styleUrls: ['./feature-list-feature.component.scss']
export class FeatureListFeatureComponent extends AbstractFeatureListFeatureComponent { })
export class FeatureListFeatureComponent extends AbstractFeatureListFeatureComponent {
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, config:AppConfig) {
super(store, itemTypeService,config); constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, config:AppConfig) {
} super(store, itemTypeService,config);
} }
}

View File

@ -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 { Location } from '@angular/common';
import { Feature } from 'ol'; import { Feature } from 'ol';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
@ -12,6 +12,7 @@ import { IQueryState } from '@farmmaps/common';
@Injectable() @Injectable()
@Directive()
export abstract class AbstractFeatureListComponent { export abstract class AbstractFeatureListComponent {
@Input() features: Array<Feature>; @Input() features: Array<Feature>;
@Input() queryState: IQueryState; @Input() queryState: IQueryState;

View File

@ -1,35 +1,37 @@
import { Component, Input, Injectable} from '@angular/core'; import { Component, Input, Injectable,Directive} from '@angular/core';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer'; import * as mapReducers from '../../reducers/map.reducer';
import { commonReducers,ItemTypeService,IListItem } from '@farmmaps/common'; import { commonReducers,ItemTypeService,IListItem } from '@farmmaps/common';
@Injectable() @Injectable()
export abstract class AbstractItemListItemComponent { @Directive()
@Input() item: IListItem export abstract class AbstractItemListItemComponent {
@Input() item: IListItem
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService) {
} constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService) {
} }
}
@Injectable()
export abstract class AbstractItemWidgetComponent { @Injectable()
@Input() item: IListItem @Directive()
export abstract class AbstractItemWidgetComponent {
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService) { @Input() item: IListItem
}
} constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService) {
}
@Injectable() }
@Component({
selector: 'fm-map-item-list-item', @Injectable()
templateUrl: './item-list-item.component.html', @Component({
styleUrls: ['./item-list-item.component.scss'] selector: 'fm-map-item-list-item',
}) templateUrl: './item-list-item.component.html',
export class ItemListItemComponent extends AbstractItemListItemComponent { styleUrls: ['./item-list-item.component.scss']
})
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService) { export class ItemListItemComponent extends AbstractItemListItemComponent {
super(store, itemTypeService);
} constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService) {
} super(store, itemTypeService);
}
}

View File

@ -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 { Location } from '@angular/common';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer'; import * as mapReducers from '../../reducers/map.reducer';
@ -8,6 +8,7 @@ import { tassign } from 'tassign';
@Injectable() @Injectable()
@Directive()
export abstract class AbstractItemListComponent { export abstract class AbstractItemListComponent {
@Input() items: Array<IListItem> @Input() items: Array<IListItem>
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService, private location: Location) { constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService, private location: Location) {

View File

@ -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 {Location} from '@angular/common';
import {Store} from '@ngrx/store'; import {Store} from '@ngrx/store';
import * as mapReducers from '../../reducers/map.reducer'; import * as mapReducers from '../../reducers/map.reducer';
@ -9,6 +9,7 @@ import { IItemLayer } from '../../models/item.layer';
@Injectable() @Injectable()
@Directive()
export abstract class AbstractSelectedItemComponent { export abstract class AbstractSelectedItemComponent {
@Input() item: IItem @Input() item: IItem
@Input() itemLayer: IItemLayer; @Input() itemLayer: IItemLayer;