obenjiro / vscode-arrr Goto Github PK
View Code? Open in Web Editor NEWThe extension provides refactoring tools for your Angular codebase
License: MIT License
The extension provides refactoring tools for your Angular codebase
License: MIT License
Currently ARRR generates:
All files are generated with default preferences. But if Angular schematics is custom, generated files should be different.
My request is to use schematics, defined in angular.json.
For example, we use these options for components:
...
"changeDetection": "OnPush",
"export": false,
"flat": false,
"inlineStyle": false,
"inlineTemplate": false,
"skipImport": false,
"skipTests": true,
"style": "scss",
"viewEncapsulation": "Emulated",
"displayBlock": true
...
First of all I really like the extension and I think it will be very useful for a lot of people!
Right now it doesn't give you the option to choose the declaring NgModule. Most of the time I want to extract into a SharedModule
, it would be really nice if I would have the option to choose where I create the component.
Step to reproduce the problem:
ng new demo1 --routing --style=css && cd demo1
demo1
projectsrc\app\app.component.html
<div class="content" role="main">
whole section and run Extract Angular Component
.Actual result:
<app-main [title]="title" [selection]="selection"></app-main>
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css']
})
export class MainComponent {
@Input() title;
@Input() selection;
constructor() { }
}
The selection
should not treat as a input because it's an template reference variable within the selection.
Expected result:
<app-main [title]="title"></app-main>
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css']
})
export class MainComponent {
@Input() title;
constructor() { }
}
Unable to create component using hyphen. When I do, an error message from VSCode appears in the bottom right and says "Illegal Characters In Path."
It would be nice to have the option to name new components with a hyphen.
If the declaring module is not AppModule
it would be nice to have the option to export by the declaring module
I writing lol-kek in HTML and in the current component module, i am importing the component Kek module
When I try to extract the following html I get *.component.undefined
instead of the css/scss.
<mat-form-field>
<input
formControlName="number"
matInput
placeholder="Enter a number"
i18n-placeholder
type="number"
/>
</mat-form-field>
File structure:
In the component class the styleUrl is there correctly:
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-number-input',
templateUrl: './number-input.component.html',
styleUrls: ['./number-input.component.css']
})
export class NumberInputComponent {
constructor () {}
}
This is awesome. I have one question about the "decisions" when transforming this
<app-card *ngFor="let task of tasks" cdkDrag><ion-icon cdkDragHandle [src]="iconsService.getIconPath('drag')"> </ion-icon>
<div class="content">
<p>{{task.title}}</p>
<p>{{task.instructions}}</p>
</div>
<app-delete-card-button></app-delete-card-button>
</app-card>
Into this:
<app-drag-task [tasks]="tasks" [iconsService]="iconsService" [task]="task"></app-drag-task>
Would it be possible to keep the ng-for in the new component, and remove the task array?
For projects that use SCSS or others, it would be nice for the extension to check the angular.json
file and see what type of CSS file is being used, and create that type of file instead.
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.