I am started learning knockoutjs and I have faced an error. The Aptana editor shows an error at the:
data-bind: ....
property of the tag complaining that it is a proprietary tag. I have made sure to include all the needed javascript files plus I have checked a prior question:knockoutjs template not working.
Here is my code:
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='jquery-1.8.2.min.js'></script>
<script src='jquery.tmpl.min.js' type='text/javascript'></script>
<script src='knockout-2.2.0.js' type='text/javascript'></script>
</head>
<body>
<script>
function AppViewModel() {
this.firstName = "Bert";
this.lastName = "Bertington";
}
ko.applyBindings(new AppViewModel());
</script>
<p>First name: <strong data-bind="text: firstName"></strong></p>
<p>Last name: <strong data-bind="text: lastName"></strong></p>
</body>
</html>
Even after ignoring Aptana and hoping that the browser will show it I still get nothing. I am using Firefox 16 but I also tried on IE 8 but to no avail.
Move your script tag underneath your markup.