0

Is it possible to clone an DOM element in AngularJS when clicked on it without using a custom function defined in controller/scope?

Example:

<div>
  <div ng-click="create copy of this">some content</div>
</div>

becomes:

<div>
  <div ng-click="create copy of this">some content</div>
  <div ng-click="create copy of this">some content</div>
</div>

1 Answer 1

1

No. ng-click always calls functions in the scope. You could create a directive if you wanted to.

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

1 Comment

And Expressions like ng-click="variable=4", too.

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.