Skip to content

Instantly share code, notes, and snippets.

@myabc
Created December 11, 2014 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myabc/e855281c3a68bcb1f974 to your computer and use it in GitHub Desktop.
Save myabc/e855281c3a68bcb1f974 to your computer and use it in GitHub Desktop.
Inplace Editor directive
<!--
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>
@0xF013
Copy link

0xF013 commented Dec 11, 2014

I'd rather create a separate component for each case like inplace-{{type}}-editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment