<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type='text/javascript' src='knockout-3.4.0.js'></script> </head> <body> The first name is <span data-bind="text: firstName"></span><br/> The last name is <span data-bind="text: lastName"></span><br/> The funll name is <span data-bind="text: fullName"></span><br/> </body> </html> <script> function AppViewModel() {...
Category: Knockout js
Knockout js
1. Basic viewmodel and observableArray
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type='text/javascript' src='knockout-3.4.0.js'></script> </head> <body> The name is <span data-bind="text: personName"></span> The age is <span data-bind="text: personAge"></span> The funll name is <span data-bind="text: fullName"></span> </body> </html> <script> var myViewModel = { personName:...