(vscode-angular2-component-generator)
Extension automatically creates folder for angular2 component containing :
component.ts
module.ts
component.html
component.css
- Right click on on the file or folder in the explorer
- Select "New Angular2 Component"
- Enter component name in the pop up in camelCase
- global:
- quotes -
single
ordouble
in other words ('
or"
) - generateFolder -
true
orfalse
generate or not separate folder for newly created component
- quotes -
- create true / false - (controls weather to generate this file or not)
- extension - extension of generated file (e.g. you might want to change "scss" to just plain "css")
- template - path to the custom template for the generated file
- {selector} -> replaced with
lower case, dash separated string
- {templateUrl} -> replaced with
${selector}.component.html
- {styleUrls} -> replaced with
${selector}.component.css
- {className} -> replaced with
componentName in PascalCase
- {selector} -> replaced with
Use the "template" key to override default templates for the extension
{
"global": {
"quotes": "single", // or "double",
"generateFolder": true, // or false
},
"files": {
"component": {
"create": true,
"extension": "ts",
"template": "${workspaceRoot}/myComponent.template"
},
"css": {
"create": true,
"extension": "scss"
},
"html": {
"create": true,
"extension": "html"
},
"module": {
"create": true,
"extension": "ts"
}
}
}
In the global configuration part set the generateFolder
key to false
.
- Fixes
styleUrl
extension (css/scss) when generating component withscss
(issue #5)
- Allow a global configuration object to be defined
- Added quotes property: singleor double in other words ( ' or " )
- Merged defaultconfiguration (assets folder) with userdefined configuration therefore the whole configuration object doesn't need to be copied for a single config change
- Added
generateFolder
property to global config toenable
/disable
generation of the component in the separate folder
Please report here