Last active
October 20, 2021 15:48
-
-
Save Karytonn/b5756424cf4a5a74ef6c0dc030e6f89f to your computer and use it in GitHub Desktop.
Angular >> Move to different page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'app-visit-rangle', | |
template: ` | |
<button | |
type="button" | |
(click)="goTopage()"> | |
Visit Rangle | |
</button> | |
` | |
}) | |
export class VisitRangleComponent { | |
goTopage() { | |
location.href = 'https://rangle.io'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//post | |
<button [routerLink]="['/ouvidoria', 'solicitacao' ]" class="btn btn-light btn-block btn-ouvidoria"> | |
<img src="../assets/icons/01-chat.svg" alt="Solicitações"> | |
<p>Solicitação</p> | |
</button> | |
//get | |
@Component({ | |
selector: 'app-resultados-de-busca', | |
templateUrl: './resultados-de-busca.component.html', | |
styleUrls: ['./resultados-de-busca.component.scss'] | |
}) | |
export class ResultadosDeBuscaComponent implements OnInit { | |
public searchParms: string; | |
constructor(private activatedRoute: ActivatedRoute) { } | |
ngOnInit(): void { | |
this.searchParms = this.activatedRoute.snapshot.params.words | |
console.log(this.searchParms); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button [routerLink]="[ '/ouvidoria' ]" class="btn btn-light btn-block btn-ouvidoria"> | |
<img src="../assets/icons/01-chat.svg" alt="Solicitações"> | |
<p>Solicitação</p> | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dataCar is an Array in the component.ts | |
<a [href]="url" target="_blank">YouTube</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment