export default defineConfig({
plugins: [vue({
template: {
compilerOptions: {
whitespace: 'preserve'
}
}
})],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
})
const routes: Routes = [
{
path: 'category', component: LayoutShopComponent, children: [
{path: '**', component: CategoryListComponent},
]
},
];
constructor(
private route: ActivatedRoute
) {
route.url.subscribe((data) => {
this.child = data.map(value => value.path);
const arraySize = data.length;
if (arraySize > 0) {
this.parentSlug = data[arraySize - 1].path;
}
});
this.loadData();
}
<a routerLink="{{category.slug}}" class="text-body">{{category.name}}</a>
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const token = this.authService.getAuthorizationToken();
if (token) {
return true;
}
// not logged in so redirect to sign-in page with the return url
this.router.navigate(['/account/sign-in'], { queryParams: { returnUrl: state.url }});
return false;
}
public function addToSwimmingPool(Swimming $animal): void
{
$this->pool[] = $animal;
}
public function addToSwimmingPool($animal): void { ... }
public function addToSwimmingPool(Penguin $animal): void { ... }
public static $token;
public function __constructor() {
self::$token = Yii::$app->params['token'];
}
{provide: DEFAULT_CURRENCY_CODE, useValue: 'RUB'}