0

I currently have a generic list component and I want to add, depending on where I use it, different callbacks for adding/removing/updating items to that list.

My current implementation looks like this:

<div list-callback1>
    <generic-list
        add-callback="listCallback1.add()"
        update-callback="listCallback1.add(id, name)"
        delete-callback="listCallback1.delete(id)"></generic-list>
</div>

My question:

Is there a way to decrease nesting? Because when I add the directive directly to my component I get a compile error.

1
  • 2
    It's not so clear what you are trying to achieve with the code, can you add a working fiddle? Besides, make sure you prompt the compile error angularjs threw. Commented Nov 22, 2018 at 10:13

1 Answer 1

0

Ok, it was a different problem.

I had scope: true in my list-callback1 directive.

After removing that, all works fine. Thanks for the help

Sorry I couldn't post more code, but I am restricted by my employer ;)

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

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.