Created
December 11, 2014 11:07
-
-
Save myabc/e855281c3a68bcb1f974 to your computer and use it in GitHub Desktop.
Inplace Editor directive
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
<!-- | |
PROBLEM: Inplace Editor directive has too many responsibilities. | |
--> | |
<inplace-editor | |
ined-type="select2" | |
ined-entity="workPackage" | |
ined-attribute="assignee" | |
ined-attribute-embedded="false"> | |
</inplace-editor> | |
<!-- | |
SOLUTION: | |
* create an inplace wrapper component, that transcludes component. | |
* for the frequent HTML/text-editing use-case, create a seperate component. | |
--> | |
<inplace-html-editor | |
ined-entity="workPackage" | |
ined-attribute="subject"> | |
</inplace-editor> | |
<inplace-editor | |
ined-entity="workPackage" | |
ined-attribute="assignee" | |
ined-attribute-embedded="false"> | |
<select ng-model="$inplace.value" | |
ng-options="item.href as item.title for item in $inplace.options"> | |
</select> | |
</inplace-editor> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd rather create a separate component for each case like inplace-{{type}}-editor