Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidLoad() {
const tree = readRoutes(this.el);
this.routes = flattenRouterTree(tree);
this.redirects = readRedirects(this.el);
if (Build.isDev) {
console.debug('%c[@ionic/core]', 'font-weight: bold', `ion-router registered ${this.routes.length} routes`);
for (const chain of this.routes) {
const path: string[] = [];
chain.forEach(r => path.push(...r.path));
const ids = chain.map(r => r.id);
console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
}
}
// perform first write
this.dom.raf(() => {
console.debug('[OUT] page load -> write nav state');
this.onPopState();
});
}
async get(menu) {
if (Build.isDev) {
if (menu === 'left') {
console.error('menu.side=left is deprecated, use "start" instead');
return undefined;
}
if (menu === 'right') {
console.error('menu.side=right is deprecated, use "end" instead');
return undefined;
}
}
await this.waitUntilReady();
if (menu === 'start' || menu === 'end') {
// there could be more than one menu on the same side
// so first try to get the enabled one
const menuRef = this.find(m => m.side === menu && !m.disabled);
if (menuRef) {
return menuRef;
constructor() {
if (Build.isDev) {
console.warn(`[DEPRECATED][ion-modal-controller] Use the modalController export from @ionic/core:
import { modalController } from '@ionic/core';
const modal = await modalController.create({...});`);
}
}
constructor() {
if (Build.isDev) {
console.warn(`[DEPRECATED][ion-alert-controller] Use the alertController export from @ionic/core:
import { alertController } from '@ionic/core';
const alert = await alertController.create({...});`);
}
}
rootChanged() {
const isDev = Build.isDev;
if (this.root !== undefined) {
if (!this.useRouter) {
this.setRoot(this.root, this.rootParams);
} else if (isDev) {
console.warn(
' does not support a root attribute when using ion-router.'
);
}
}
}
componentWillLoad() {
if (Build.isDev) {
if (this.component && this.el.childElementCount > 0) {
console.error('You can not use a lazy-loaded component in a tab and inlineed content at the same time.' +
`- Remove the component attribute in: ` +
` or` +
`- Remove the embeded content inside the ion-tab: `);
}
}
}
@Method()
constructor() {
if (Build.isDev) {
console.warn(`[DEPRECATED][ion-menu-controller] Use the menuController export from @ionic/core:
import { menuController } from '@ionic/core';`);
}
}
rootChanged() {
const isDev = Build.isDev;
if (this.root !== undefined) {
if (!this.useRouter) {
this.setRoot(this.root, this.rootParams);
}
else if (isDev) {
console.warn(' does not support a root attribute when using ion-router.');
}
}
}
componentWillLoad() {
constructor() {
if (Build.isDev) {
console.warn(`[DEPRECATED][ion-popover-controller] Use the popoverController export from @ionic/core:
import { popoverController } from '@ionic/core';
const popover = await popoverController.create({...});`);
}
}
componentWillLoad() {
if (Build.isDev) {
if (this.component !== undefined && this.el.childElementCount > 0) {
console.error('You can not use a lazy-loaded component in a tab and inlined content at the same time.' +
`- Remove the component attribute in: ` +
` or` +
`- Remove the embedded content inside the ion-tab: `);
}
}
}