npx @aditya6838/angular-starter <app-name>
Example - npx @aditya6838/angular-starter my-angular-app
This command will download all starter files from npm then use ng serve --open
or npm start
to open app in browser.
ng new project-name
--strict
to opt in to Strict Mode--routing
to handle the navigationcd project-name
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init
module.exports = {
content: ["./src/**/*.{html,ts}"],
};
@tailwind base;
@tailwind components;
@tailwind utilities;
<h1 class="text-3xl font-bold underline text-red-400">
Hello world!
</h1>
ng serve --open
Run npm install tw-elements
Modify tailwind.config.js
content:
[
"./src/**/*.{html,ts}",
"./node_modules/tw-elements/dist/js/**/*.js",
],
plugins:
[
require("tw-elements/dist/plugin"),
],
Add ./node_modules/tw-elements/dist/js/index.min.js
in angular.json
"projects": {
"project-name": {
"architect": {
"build": {
"options": {
"scripts": [
"./node_modules/tw-elements/dist/js/index.min.js"
]
}
}
}
}
}
Add test code in app.component.html
<h1 class="text-3xl font-bold underline text-red-400">
Hello world!
</h1>
Run ng serve --open
npm i --save-dev @types/jquery
"compilerOptions": {
"types": [ "jquery" ]
}
ng add @angular/material
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.