Comments (3)
angular: 2.1.2
angular-cli: 1.0.0-beta.21
import { PolymerElement } from '@vaadin/angular2-polymer';
export class Polymer {
static forRoot() {
return [
PolymerElement('paper-button'),
PolymerElement('paper-checkbox'),
PolymerElement('paper-input')
]
}
}
@NgModule({
imports: [],
declarations: [Polymer.forRoot()],
exports: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentModule1 { }
@NgModule({
imports: [],
declarations: [Polymer.forRoot()],
exports: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentModule2 { }
from angular-polymer.
Hi, thanks for asking. Currently there is no way of passing arrays.
As I think, we have to replace the PolymerElement
function with something else anyway. Maybe we can solve this repetitive declaration issue at the same time with #86.
from angular-polymer.
I like the solution but it forces me to load all three polymer elements in both the modules which generally isn't the case. In some modules i may require all three of them and in some just one of them.
This however gave me an idea to make this parameterized the following way.
import { PolymerElement } from '@vaadin/angular2-polymer';
export class Polymer {
static load(elements) {
return elements.map( v => PolymerElement(v) )
}
}
and then...
@NgModule({
imports: [],
declarations: [Polymer.load(['paper-card','paper-checkbox'])],
exports: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentModule1 { }
@NgModule({
imports: [],
declarations: [Polymer.load('paper-dropdown-menu')],
exports: [],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ComponentModule2 { }
I have not tested it yet. Awaiting comments.
from angular-polymer.
Related Issues (20)
- Configure CI build HOT 8
- Using with angular-cli HOT 4
- tests fail with newest jasmine-core lib
- Error encountered resolving symbol values statically HOT 5
- Angular-Polymer meetup 2/17/2017 HOT 3
- [innerHTML] not working when defining PolymerElement HOT 9
- Angular 2, Problem in navigating from google chart to other component by click handler HOT 4
- Error: Cannot find a differ supporting object [vaadin-combo-box] HOT 4
- Renderer does not work with direct attributes HOT 2
- Renderer does not support styles inside angular component HOT 1
- Renderer folder is not copied when adding it as npm dependency HOT 1
- Is this compatible with angular 4.0.0? HOT 2
- How to get a build version of polymer components ? HOT 18
- documentation link not working HOT 1
- ng4 Quickstart with @vaadin/angular2-polymer - gives error - BrowserDomAdapter HOT 7
- Deprecate PolymerElement function
- Support Angular 4.x in the Renderer HOT 10
- Fix npm version HOT 3
- Property binding for complex Polymer components doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-polymer.