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

+1 vote
asked Feb 6, 2020 in JavaScript by rajeshsharma
+1 vote
0 votes
asked Apr 14 in AWS by DavidAnderson
...