Pregunta

The docs at https://www.dartlang.org/polymer-dart/upgrading-to-polymer-from-web-ui.html state the following:

We recommend creating a component for your “application” HTML page. Polymer believes that everything is a component.

What exactly does this mean? Is the complete index HTML page a component that is then embedded in another HTML page or does the index HTML page contain a <polymer-element> declaration?

Is there an example out there that demonstrates this?


Edit: added example for solution

<!DOCTYPE html>

<html>
  <head>
    <title>My Application</title>
    <meta charset="utf-8">
    <link rel="import" href="my_app.html">
    <script src="packages/polymer/boot.js"></script>
  </head>

  <body>
    <my-app></my-app>
  </body>

</html>
¿Fue útil?

Solución 2

For example the Polymer Sandbox have a page source that contains almost nothing except a <tk-app> element.

Otros consejos

For a Dart example, Seth Ladd's polymer.dart examples have a good example:

https://github.com/sethladd/dart-polymer-dart-examples/blob/master/web/todo_element/index.html

<!DOCTYPE html>

<html>
  <head>
    <title>TODO example in Polymer</title>
    <link rel="stylesheet" href="css/bootstrap_small.min.css">
    <link rel="import" href="todo.html">
    <script src="packages/polymer/boot.js"></script>
  </head>
  <body>
    <todo-app></todo-app>
  </body>
</html>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top