Using textAngular inside ng-repeat with same name attribute value? · Issue #240 · textAngular/textAngular · GitHub
Skip to content

Using textAngular inside ng-repeat with same name attribute value? #240

Closed

Description

@yulric

Hi there,
Thanks a lot for the directive. I am trying to use angularjs validation with textAngular but unfortunately I have run into a problem. I have an ng-repeat which repeats an ng-form inside of which I have a textAngular element. However the ng-repeat array can't have more than one element because I get the error "textAngular Error: An editor with the name already exists".I was wondering if there was a way to fix this problem. Thanks a lot for your help.

Edit: Made a plunker so you can see the problem http://plnkr.co/edit/xdbP7ouKOf4ySRRyaAo0
Once you run the plunker go to the console to see the issue

Activity

  1. SimeonC commented on Jul 14, 2014

    @SimeonC
    Collaborator

    As the error suggests each textAngular directive requires a unique name attribute. There are two solutions to this:

    1. Remove the name attribute and let textAngular dynamically set the name itself (note that this can ).
    2. Use the following: <div text-angular ng-model='item.Model' name='textAngularEditor{{$index}}'></div>

    As you're using it inside an ng-form I'm assuming you want to be doing validation so you'll probably want to use option 2.

    To help us improve textAngular what would a better error message have been?

  2. yulric commented on Jul 15, 2014

    @yulric
    Author

    Hi thanks for the reply. I think the error message is fine, it explains the problem pretty well. I thought this was an issue since the error was coming from angularjs and not textAngular but I guess I was wrong there. Maybe a note in the docs regarding this feature would be helpful in the future? Thanks for the possible solutions.

  3. pelepelin commented on Nov 10, 2015

    @pelepelin

    Can't this limitation be removed?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions