Skip to content

Instantly share code, notes, and snippets.

Angular Router Deep Dive

The Angular Router is one of the most important libraries in an Angular application. Without it, apps would be single view/single context apps. With Angular Router, we can create rich apps that are linkable and have rich animations (when paired with Ionic of course). Let's look at the basics of the Angular Router and how we can configure it for Ionic apps.

A simple Route

For most apps, having some sort of route is often required. The most basic configuration looks a bit like this:

import { Injectable } from '@angular/core';
import { CanLoad, Router } from '@angular/router';
import { Storage } from '@ionic/storage';
@Injectable({
providedIn: 'root'
})
export class CheckTutorial implements CanLoad {
constructor(private storage: Storage, private router: Router) {}
canLoad() {
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
from os import path
from denite.source.base import Base
from denite.util import globruntime
from ..kind.command import Kind as Command
from itertools import filterfalse
class Source(Base):
def __init__(self, vim):
save-prefix=
<div>
<!-- a named slot -->
<slot name="start"></slot>
<p>Here is content from in the component</p>
<!-- default slot, will be used by default -->
<slot></slot>
</div>
<my-component>
.md ion-grid {
}
.ios ion-grid {
}
#!/usr/bin/env node
const puppeteer = require('puppeteer');
const fs = require('fs');
const args = process.argv.slice(2);
const host = args[0] || 'http://127.0.0.1:8080';
const indexMatches = [
'.gz',
'.map',
'3rdpartylicenses.txt',
'ngsw-manifest.json',
"| \/ (_) | (_)
"| . . |_| | _____ ___ _ ____ ___ _ __ ___ _ __ ___
"| |\/| | | |/ / _ \/ __| | '_ \ \ / / | '_ ` _ \| '__/ __|
"| | | | | < __/\__ \ | | | \ V /| | | | | | | | | (__
"\_| |_/_|_|\_\___||___/ |_| |_|\_/ |_|_| |_| |_|_| \___|
"
" Author: Mike Hartington
" repo : https://github.com/mhartington/dotfiles/
"
" Plugins ------------------------------------------------------------------{{{
function ghUpdate() {
if git remote | grep upstream > /dev/null; then
echo "upstream is set"
elif [ -z "$1" ]; then
read "?Whats the URl of the original repo? " answer
git remote add upstream $answer
else
git remote add upstream $1
fi
git fetch upstream