Mudanças entre as edições de "Angular"

De BrapciWiki
Ir para navegação Ir para pesquisar
Linha 13: Linha 13:
 
  ng g s data/isbn
 
  ng g s data/isbn
 
* Incluir no app.component (Http)
 
* 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==
 
==Bootstrap Angular==

Edição das 21h25min de 14 de junho de 2023

NG Client

Criando projeto

ng new [project name]

Componentes

Novo componente

ng g c [/modules/brapci/headers/head]

Nova Intefae

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

Variáveis

public title:string = "Brapci"

Rodando servidor

ng s

Produção

Gerando Build