Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(project landing page): use service to get contact type; correct…
… identation;
- Loading branch information
Snehal Kumbhar
committed
Mar 1, 2021
1 parent
37b3dce
commit 6bb29d8
Showing
8 changed files
with
118 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { IId, Organization, Person } from '@dasch-swiss/dsp-js'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class DatasetMetadataService { | ||
|
||
constructor() { } | ||
|
||
/** | ||
* used in project metadata page | ||
* determine if the object is of type Person or Organization or Iid | ||
* @param obj Person | Organization | IId | ||
*/ | ||
getContactType(obj: Person | Organization | IId): string { | ||
if (obj instanceof Person) { | ||
return 'person'; | ||
} | ||
if (obj instanceof Organization) { | ||
return 'organization'; | ||
} | ||
return undefined; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.