mirror of
https://github.com/jlengrand/polymer-array-bubble-up-example.git
synced 2026-03-10 08:41:23 +00:00
Initiates repo
This commit is contained in:
64
.gitignore
vendored
Normal file
64
.gitignore
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# no need to share proxy info
|
||||
.npmrc
|
||||
.bowerrc
|
||||
|
||||
yarn.lock
|
||||
28
app/components/another-component/another-component.html
Normal file
28
app/components/another-component/another-component.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<link rel="import" href="/polymer/polymer.html">
|
||||
|
||||
<dom-module id="another-component">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h3>{{element.name}}</h3>
|
||||
<h4>{{element.person.name}}</h4>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'another-component',
|
||||
properties: {
|
||||
element: {
|
||||
type: Object,
|
||||
reflectToAttribute: true,
|
||||
notify: true
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
35
app/components/example-component/example-component.html
Normal file
35
app/components/example-component/example-component.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<link rel="import" href="/polymer/polymer.html">
|
||||
<link rel="import" href="/components/another-component/another-component.html">
|
||||
|
||||
<dom-module id="example-component">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>Example</h1>
|
||||
|
||||
<h2>List of elements</h2>
|
||||
<template is="dom-repeat" items="{{elements}}" as="item" indexAs="index">
|
||||
<another-component element="{{item}}" ident$="{{index}}"></another-component>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
var fred = {"name": "fred"};
|
||||
var tom = {"name": "tom"}
|
||||
|
||||
Polymer({
|
||||
is: 'example-component',
|
||||
properties: {
|
||||
elements: {
|
||||
type: Array,
|
||||
value: [{"name": "Main1", "person": fred}, {"name": "Main2", "person": tom}, {"name": "Main3", "person": fred}],
|
||||
notify: true
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
14
app/index.html
Normal file
14
app/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>An example of how to *not* have items update an array in Polymer</title>
|
||||
</head>
|
||||
<script src="webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="components/example-component/example-component.html">
|
||||
|
||||
<body>
|
||||
<example-component></example-component>
|
||||
</body>
|
||||
</html>
|
||||
17
bower.json
Normal file
17
bower.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "polymer-hot-reloading-example",
|
||||
"description": "A simple example of polymer project with hot reloading",
|
||||
"dependencies": {
|
||||
"polymer": "^2.0.0"
|
||||
},
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "^1.0.1"
|
||||
}
|
||||
}
|
||||
1837
package-lock.json
generated
Normal file
1837
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
package.json
Normal file
15
package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "polymer-hot-reloading-example",
|
||||
"version": "1.0.0",
|
||||
"description": "A simple example of polymer project with hot reloading",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "browser-sync start --server app -f app --serveStatic bower_components --no-notify"
|
||||
},
|
||||
"author": "Julien Lengrand-Lambert <julien@lengrand.fr>",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"browser-sync": "^2.18.12",
|
||||
"bower": "^1.8.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user