angularclass / angular2-conventions-loader Goto Github PK
View Code? Open in Web Editor NEWAllow default for `@Component` metadata for Angular 2
Home Page: http://bit.ly/angularclasscom
License: Apache License 2.0
Allow default for `@Component` metadata for Angular 2
Home Page: http://bit.ly/angularclasscom
License: Apache License 2.0
I dont kow, if this is a good idea. But there is the convention to suffix the files with .component.ts. This means that we can also add the @component decorator
Hi, I am trying this with Webpack 2 (which supports async routes through loadChildren), and it seems that files in the async components are not "patched" by this module; html and css must be specified manually. Maybe it's a limitation and not a bug, in this case just close this request. Just wanted to inform you guys.
Hi all, I just verified that this module wrongly includes the "template: " property in @directive classes, throwing an error on webpack compilation:
/home/mc128k/node/etiquette-client/node_modules/ng2-select/components/select/off-click.ts:4:13
Argument of type '{ template: string; selector: string; }' is not assignable to parameter of type 'DirectiveMetadataType'.
Object literal may only specify known properties, and 'template' does not exist in type 'DirectiveMetadataType'.
[default] Checking finished with 1 errors
Here is the code that caused the issue:
@Directive({
selector: '[offClick]'
})
As you can read, it's found in the ng2-select component
The convention recommends to use prefixes for selector. Would be awesome to have a setting for this.
E.g. when I use the query "selectorPrefix=my" the selector for the AppComponent class becomes "my-app"
Hi,
I really like the idea and I would like to see support for less and sass.
Hi,
does it support with sourcemap? I guess so, because it runs before typescript compiler. Is this right?
auto name pipes
In ionic applications you don't need to put selectors on page components otherwise stuff will be broken when you open that page on device.
So, there need to be a callback function, which can detect whether selector
option is required or not
Running angular2-seed I ran into the issue noted at https://github.com/AngularClass/angular2-seed/issues/6
I had to change the require lines generated to the following
line 147: metadata = 'template: require("./' + lastFileName + htmlExtension + '"),\n' + metadata;
line 163: metadata = 'styles: [require("./' + lastFileName + cssExtension + '")],\n' + metadata;
as before it was simply appending .
to the start of all file names causing an issue, I'm not sure if this is windows specific as I have no other environments to test on
Hi,
I would like to have another feature ;) ... I am too lazy to write imports for all types, therefore I just use
import * as Ng2 from '@angular/core';
Can you add something like a prefix for @component and @directive?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.