Angular – První projekt “hello-world”

Vytvořit projekt

Poznámka: Všechna nastavení jsou ve výchozím stavu.

/app/Home/angular/projects$ ng new hello-world
? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options
and autocomplete arguments. (Enabling autocompletion will modify configuration files in your home directory.) Yes
Appended `source <(ng completion script)` to `/home/posmura/.bashrc`. Restart your terminal or run the following to autocomplete `ng` commands:

source <(ng completion script)
? Would you like to share pseudonymous usage data about this project with the Angular Team
at Google under Google’s Privacy Policy at For more
details and how to change this setting, see No
Global setting: disabled
Local setting: No local workspace configuration file.
Effective status: disabled
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE hello-world/ (1064 bytes)
CREATE hello-world/.editorconfig (274 bytes)
CREATE hello-world/.gitignore (548 bytes)
CREATE hello-world/angular.json (2947 bytes)
CREATE hello-world/package.json (1042 bytes)
CREATE hello-world/tsconfig.json (863 bytes)
CREATE hello-world/.browserslistrc (600 bytes)
CREATE hello-world/karma.conf.js (1428 bytes)
CREATE hello-world/ (287 bytes)
CREATE hello-world/tsconfig.spec.json (333 bytes)
CREATE hello-world/.vscode/extensions.json (130 bytes)
CREATE hello-world/.vscode/launch.json (474 bytes)
CREATE hello-world/.vscode/tasks.json (938 bytes)
CREATE hello-world/src/favicon.ico (948 bytes)
CREATE hello-world/src/index.html (296 bytes)
CREATE hello-world/src/main.ts (372 bytes)
CREATE hello-world/src/polyfills.ts (2338 bytes)
CREATE hello-world/src/styles.css (80 bytes)
CREATE hello-world/src/test.ts (749 bytes)
CREATE hello-world/src/assets/.gitkeep (0 bytes)
CREATE hello-world/src/environments/ (51 bytes)
CREATE hello-world/src/environments/environment.ts (658 bytes)
CREATE hello-world/src/app/app.module.ts (314 bytes)
CREATE hello-world/src/app/app.component.css (0 bytes)
CREATE hello-world/src/app/app.component.html (23083 bytes)
CREATE hello-world/src/app/app.component.spec.ts (971 bytes)
CREATE hello-world/src/app/app.component.ts (215 bytes)
✔ Packages installed successfully.
hint: Using ‚master‘ as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: git config –global init.defaultBranch <name>
hint: Names commonly chosen instead of ‚master‘ are ‚main‘, ‚trunk‘ and
hint: ‚development‘. The just-created branch can be renamed via this command:
hint: git branch -m <name>
Successfully initialized git.

/app/Home/angular/projects$ ll
celkem 12
drwxr-xr-x 3 posmura users 4096 zář 22 10:57 ./
drwxr-xr-x 3 posmura users 4096 zář 22 10:46 ../
drwxr-xr-x 6 posmura users 4096 zář 22 10:58 hello-world/

Spustit aplikaci

/app/Home/angular/projects$ cd hello-world
/app/Home/angular/projects/hello-world (master)$ ng serve –open
✔ Browser application bundle generation complete.

Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 1.77 MB |
polyfills.js | polyfills | 318.01 kB |
styles.css, styles.js | styles | 210.09 kB |
main.js | main | 47.74 kB |
runtime.js | runtime | 6.52 kB |

| Initial Total | 2.34 MB

Build at: 2022-09-22T09:07:03.001Z – Hash: 3be48683e649a997 – Time: 7341ms

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

✔ Compiled successfully.