3

I have a AngularJs App where we use UI.Bootstrap Tabs to create and delete workspaces.
I'm wanting to use X-editable to edit the name of the workspace/tab but within the tab-header directive:

<tab-heading>
    <span editable-text="item.title">{{item.title}}</span>
</tab-heading>

As it is, it comes up with an inline edit on-click, but does not update the scope on save.

Heres' the fiddle: http://jsfiddle.net/RDfTu/

1
  • I have the same problem. I submitted an issue for this since no one else seems to know a solution. Commented Apr 4, 2014 at 1:17

2 Answers 2

2

If you look at the generated html:

<tabset class="ng-isolate-scope ng-scope">

Isolated scopes don't inherit from any scope, so your "item.title" doesn't exist in this scope nor on any scope below it, where your tab headers are, and where x-editable is creating it's controller.

Sign up to request clarification or add additional context in comments.

2 Comments

Okay that makes sense. Is there any work around for that issue that doesn't involve changing code from any of the third party libraries (like angular)?
I'm not sure, but it doesn't look like there will be one to me.
0

I had the same issue and in my case i was able to solve it using blur attribute :

<tab-heading>
   <span editable-text="tab.name" onbeforesave="validate($data)" buttons="no" blur="submit">{{ tab.name}}</span>
 </tab-heading>

Please see the documentation.

Also please see the below code in xeditable.js:

if (shown[i]._blur === 'submit') {
        toSubmit.push(shown[i]);
      }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.