June 2017
Intermediate to advanced
873 pages
18h 9m
English
In this recipe, we will show you how to work with a JavaScript object in a Polymer component. You can find the code in the project pol_js.
web\index.html, where a component with the name pol-js is imported through <link rel="import"href="pol_js.html"> and instantiated through <pol-js></pol-js>.From this, we know that the component is defined in pol_js.html, and its code is in a file named pol_js.dart. For a discussion of the other tags, refer to the first recipe.
index.html file also includes a JavaScript person.js object:
function Person(name, gender) { this.name = name; this.gender = gender; this.greeting = function(otherPerson) { alert('I greet you ' + otherPerson.name); ...Read now
Unlock full access