If you run this well known Angular CLI command
to create a new angular project, your selector prefix is set to
If you want to have another name instead of app, like f.e. the company name, you can go to the Angular CLI JSON and changing the prefix from app to companyname.
So if you create a new component with CLI, it will get companyname instead of app at the selector.
But this has no effect on the existing components. Of course you can change the name manually. But the best way is, to set the prefix right from the start.
The CLI comand for this is simple but effiktive.
That's all. Have fun at your Angular projects
to create a new angular project, your selector prefix is set to
selector: 'app-root',
If you want to have another name instead of app, like f.e. the company name, you can go to the Angular CLI JSON and changing the prefix from app to companyname.
"prefix": "app",
"prefix": "companyname",
So if you create a new component with CLI, it will get companyname instead of app at the selector.
But this has no effect on the existing components. Of course you can change the name manually. But the best way is, to set the prefix right from the start.
The CLI comand for this is simple but effiktive.
That's all. Have fun at your Angular projects
Comments
Post a Comment