An Adobe Commerce developer is using a view model within an existing block:

What are two ways to access the view model class in the template? (Choose two.)
To access a view model within an existing block, the developer can use either of the following ways:
$block->getData('view_model'): This method will return the view model object that is assigned to the argument name ''view_model'' in the layout XML file. For example:
<referenceBlock name=''blog_posts_list''>
In the template file, the developer can access the view model object by using:
$block->getData('view_model')
$block->getData('viewModel'): This method will return the view model object that is assigned to the argument name ''viewModel'' in the layout XML file. For example:
<referenceBlock name=''blog_posts_list''>
In the template file, the developer can access the view model object by using:
$block->getData('viewModel')
The following methods are not valid and will not work:
$block->viewModel(): This method does not exist and will cause an error.
$block->getViewHodel(): This method is misspelled and will cause an error.
Royal
10 months agoYuette
10 months agoJohnson
10 months agoPamela
10 months agoShelia
10 months agoDell
11 months agoDaniela
11 months agoEleonora
11 months agoChrista
11 months agoBrigette
11 months agoEva
11 months agoVi
11 months agoDevorah
11 months agoLaquita
11 months agoRashad
12 months agoSteffanie
2 years agoOretha
2 years agoLashon
2 years agoReita
2 years agoQuentin
2 years agoMalcom
2 years agoPrecious
2 years agoRebecka
2 years agoArt
2 years agoKallie
2 years agoPete
2 years agoGilma
2 years agoTequila
2 years agoSon
2 years agoElinore
2 years agoDaron
2 years agoDierdre
2 years agoRicki
2 years agoShawnda
2 years agoStefania
2 years agoLino
2 years ago