Hi,
I am trying to instantiate web components directly from Javascript but the system does not find the public constructor. I'll put a simple example to show the context and the results:
HTML Template:
<polymer-element name="wc-foo" constructor="Foo" noscript>
<template>
Hello World!
</template>
</polymer-element>
HTML index:
<html>
<head>
<script src="general/scripts/polymer/polymer.min.js"></script>
<link rel="import" href="...">
</head>
<body>
</body>
<script>
console.log (window); // (1)
console.log (window.Foo); // (2)
var foo = new Foo (); // (3)
</script>
</html>
Console Results:
(1) I have checked the window object and it includes the constructor Foo: function (){return f(a)}
(2) I don't know what but window.Foo returns undefined
(3) ...And so, new Foo() fails: Uncaught ReferenceError: Foo is not defined
Someone can help me to understand whats is the problem?
Thanks.