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
<router-outlet></router-outlet> |
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-root', | |
templateUrl: './app.component.html', | |
styleUrls: [ './app.component.scss' ], | |
animations: [fadeAnimation] | |
}) |
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
import { trigger, animate, transition, style, query } from '@angular/animations'; | |
export const fadeAnimation = | |
trigger('fadeAnimation', [ | |
transition( '* => *', [ | |
query(':enter', | |
[ |
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
providers: [ | |
{provide: RouteReuseStrategy, useClass: CustomReuseStrategy} | |
], |
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
import { ActivatedRouteSnapshot, RouteReuseStrategy, DetachedRouteHandle } from '@angular/router'; | |
export class CustomReuseStrategy implements RouteReuseStrategy { | |
shouldDetach(route: ActivatedRouteSnapshot): boolean { | |
return false; | |
} | |
store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle): boolean { | |
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
HTTP.get('wp-json/wp/v2/pages?slug=' + this.$route.params.id) | |
.then(resp => { | |
if (resp.data == '') { | |
this.$router.push('/not-found'); | |
} | |
... |
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
{ | |
"code": "rest_post_invalid_id", | |
"message": "Invalid post ID.", | |
"data": { | |
"status": 404 | |
} | |
} |
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
function wpwa_legendary_enqueue_hashed_js() { | |
$dirJS = new DirectoryIterator(get_stylesheet_directory() . '/static/js'); | |
foreach ($dirJS as $file) { | |
if (pathinfo($file, PATHINFO_EXTENSION) === 'js') { | |
$fullName = basename($file); | |
$name = substr(basename($fullName), 0, strpos(basename($fullName), '.')); | |
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
$url = trailingslashit( get_site_url() ); | |
wp_localize_script('app', 'baseURL', array( | |
'url' => $url | |
) | |
); |
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
<script type='text/javascript'> | |
/* <![CDATA[ */ | |
var baseURL = { "url": "http:\/\/legendary.test\/" }; | |
/* ]]> */ | |
</script> |