0 votes
in JavaScript by

Explain what are the two ways of defining and inserting a view?

1 Answer

0 votes
by

First way

  • By extending the Em.View class, you have to create an oject in your JavaScript to define a view. You can declare your functions and variables inside that.
  • Now to insert a view in your template,  you have to follow the write the handlebar script {{ #view App.ViewName}}

Second Way

  • In this technique, the name of the view object is not required,while inserting into the template. But inside the object you have another property called as templateName which should be initialized with the value same as data template name attribute in handlebar’s script tag, in your template

Related questions

0 votes
asked Apr 15, 2022 in ReactJS by Robindeniel
+1 vote
+1 vote
asked May 23, 2020 in Python by sharadyadav1986
...