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
3 months agoYuette
4 months agoJohnson
4 months agoPamela
4 months agoShelia
4 months agoDell
4 months agoDaniela
5 months agoEleonora
5 months agoChrista
5 months agoBrigette
5 months agoEva
5 months agoVi
5 months agoDevorah
5 months agoLaquita
5 months agoRashad
5 months agoSteffanie
1 year agoOretha
1 year agoLashon
2 years agoReita
1 year agoQuentin
1 year agoMalcom
1 year agoPrecious
1 year agoRebecka
2 years agoArt
1 year agoKallie
1 year agoPete
2 years agoGilma
2 years agoTequila
1 year agoSon
1 year agoElinore
2 years agoDaron
2 years agoDierdre
1 year agoRicki
2 years agoShawnda
2 years agoStefania
2 years agoLino
2 years ago