-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search Ready, Add Guard(Ex), PageNoFound OK(code css)
- Loading branch information
1 parent
b8a6f4f
commit 135c0c2
Showing
13 changed files
with
150 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<p> | ||
no-page-found works! | ||
</p> | ||
<section id="wrapper" class="error-page"> | ||
<div class="error-box"> | ||
<div class="error-body text-center"> | ||
<h1>404</h1> | ||
<h3 class="text-uppercase">Page Not Found !</h3> | ||
<p class="text-muted m-t-30 m-b-30">YOU SEEM TO BE TRYING TO FIND HIS WAY HOME</p> | ||
<a [routerLink]="['/login']" routerLinkActive="router-link-active" class="btn btn-info btn-rounded waves-effect waves-light m-b-40">Back to Login</a> </div> | ||
<footer class="footer text-center">© {{year}} Admin Pro.</footer> | ||
</div> | ||
</section> |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
search works! | ||
</p> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Router, ActivatedRoute } from '@angular/router'; | ||
import { Http } from '@angular/http'; | ||
|
||
@Component({ | ||
selector: 'app-search', | ||
templateUrl: './search.component.html', | ||
styles: [] | ||
}) | ||
export class SearchComponent implements OnInit { | ||
|
||
http: Http; | ||
term: string; | ||
|
||
data: any; | ||
|
||
constructor(private activatedRoute: ActivatedRoute) { } | ||
|
||
ngOnInit() { | ||
this.activatedRoute.params.subscribe((param) => { | ||
this.term = param['term']; | ||
console.log(this.term); | ||
}); | ||
} | ||
|
||
find(term: string) { | ||
|
||
let url = `http://someAddress.com/elements`; // Example | ||
|
||
return this.http.get(url) | ||
.map((res) => { | ||
|
||
this.data = res.json(); | ||
}); | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
@Injectable() | ||
export class AdminGuard implements CanActivate { | ||
|
||
// constructor(private _servicesUser: any) { } // Ejemplo de un servicio de Usuario | ||
|
||
canActivate() { | ||
|
||
// if (this._servicesUser.user.role === 'ADMIN') { | ||
if (true) { | ||
return true; | ||
} | ||
else { | ||
console.log('Bloqueado por el Guard'); | ||
// this._servicesUser.logout(); | ||
return false; | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
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