Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Explain what are the two ways of defining and inserting a view?
Home
JavaScript
Explain what are the two ways of defining and inserting a view?
0
votes
asked
Mar 12, 2020
in
JavaScript
by
GeorgeBell
Explain what are the two ways of defining and inserting a view?
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Mar 12, 2020
by
GeorgeBell
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
...