0

I am not clear about few concepts in AnguarJS like-

Refrence (Official doc is bit confusing for these concepts.)

When should we use "ngTranscluded"?

What will be the case when we would need to create a function which performs no operation using "angular.noop"?

In what scenario we should use interpolation and in what scenario expression?

It would be great, If somebody make me clear with the small examples.

Thanks in advance.

Community
  • 1
  • 1
Ram
  • 3,887
  • 4
  • 27
  • 49

1 Answers1

0

I try to use simple terms

ngTransclude - If you want to push html code directly to the directive from outside of directive.

angular.noop - Suppose there is a function which accept a callback. Before calling of callback inside function you are doing some calculations. Now, if you want to execute those calculation but you do not have callback then you may use angular.noop.

function func (callback) {
    // Do some calculations

    callback();
}
func(function() {});
func(angular.noop);

Check this for interpolation - How can I do string interpolation in JavaScript?

Community
  • 1
  • 1
Shashank Trivedi
  • 232
  • 2
  • 16