Mudanças entre as edições de "Angular"
Ir para navegação
Ir para pesquisar
| Linha 42: | Linha 42: | ||
==Bootstrap Angular== | ==Bootstrap Angular== | ||
ng add @ng-bootstrap/ng-bootstrap | ng add @ng-bootstrap/ng-bootstrap | ||
| + | |||
| + | npm install bootstrap bootstrap-icons | ||
| + | /* Editar o arquivoi angular.json */ | ||
| + | "styles": [ | ||
| + | "node_modules/bootstrap/scss/bootstrap.scss", | ||
| + | "node_modules/bootstrap-icons/font/bootstrap-icons.css", | ||
| + | "src/styles.scss" | ||
| + | ], | ||
| + | "scripts": [ | ||
| + | "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" | ||
| + | ] | ||
| + | |||
| + | npm install @ng-bootstrap/ng-bootstrap | ||
===Variáveis=== | ===Variáveis=== | ||
Edição das 21h20min de 17 de junho de 2023
Índice
NG Client
Criando projeto
ng new [project name]
Cirar projeto com as rotas
ng new [project name] --routing --defaults
- Componentes
- Diretivas
- Serviços
- Módulos
Componentes
Novo componente
ng g c [/modules/brapci/headers/head]
Route - Routas
ng generate module app-routing --flat --module=app
Nova Inteface
ng g interface /modules/interface/vocabulary
Services
ng g s data/isbn
- Incluir no app.component (Http)
Cookie
npm install ngx-cookie-service
public ngOnInit(): void
{
if (this.CookieService.check('library'))
{
this.CookieService.set('library','1');
console.log(this.CookieService.getAll());
} else {
} }
Bootstrap Angular
ng add @ng-bootstrap/ng-bootstrap
npm install bootstrap bootstrap-icons /* Editar o arquivoi angular.json */ "styles": [ "node_modules/bootstrap/scss/bootstrap.scss", "node_modules/bootstrap-icons/font/bootstrap-icons.css", "src/styles.scss" ], "scripts": [ "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" ]
npm install @ng-bootstrap/ng-bootstrap
Variáveis
public title:string = "Brapci"
Rodando servidor
ng s