Aurelia 1.x Q&A - Sandbox at https://codesandbox.io/s/aurelia-javascript-sandbox-jnl6q85zq5
zewa666 on tr-result
test(tr): returnObjects option (compare)
zewa666 on tr-result
fix(tr): result of tr the TR f… (compare)
dependabot[bot] on npm_and_yarn
chore(deps): bump socket.io fro… (compare)
EisenbergEffect on master
doc: new one time backer (compare)
Hello @bigopon , I have a component which has a css in require that is overriding some of the core bootstrap classes..
now since I am opening this component in new tab, it is not overriding style for other pages
--- this is existing functionality ---
now I have to use this same component in a dialog and when I am loading this component in dialog it is overriding styles for the whole page - colors fonts etc.
how can I stop this. Any help will be appreciated.
model.bind
?
import { singleton } from '@aurelia/kernel';
import { LoggingWinston } from '@google-cloud/logging-winston';
import { instanceCachingFactory, registry } from 'tsyringe';
import winston, { format, Logger, LoggerOptions, transports } from 'winston';
export const LoggerDefault = 'defaultLogger';
export const LoggerTypeOrm = 'typeormLogger';
export const LoggerSecurity = 'securityLogger';
export const LoggerSecurityChild = 'childSecurityLogger';
@registry([
{ token: LoggerDefault, useFactory: instanceCachingFactory(createDefaultLogger) },
{ token: LoggerTypeOrm, useFactory: instanceCachingFactory(createTypeOrmLogger) },
{ token: LoggerSecurity, useFactory: instanceCachingFactory(createSecurityLogger) },
])
export class LoggerProvider {}
export function createDefaultLogger(): Logger {
const config: LoggerOptions =
process.env['NODE_ENV'] === 'development' ? devConfig() : serverConfig();
return winston.loggers.add(LoggerDefault, config);
}
function createTypeOrmLogger(): Logger {
const config: LoggerOptions =
process.env['NODE_ENV'] === 'development' ? devConfig() : serverConfig();
return winston.loggers.add(LoggerTypeOrm, config);
}
function createSecurityLogger(): Logger {
const config: LoggerOptions =
process.env['NODE_ENV'] === 'development' ? devConfig() : googleConfig();
return winston.loggers.add(LoggerSecurity, config);
}
function devConfig(): LoggerOptions {
const console = new transports.Console({
level: process.env.LOG_LEVEL || 'info',
debugStdout: true,
format: format.combine(format.cli(), format.splat(), format.simple()),
});
return {
transports: [console],
exceptionHandlers: [console],
};
}
function googleConfig(): LoggerOptions {
return {
transports: [
new LoggingWinston({
projectId: process.env.GOOGLE_SERVICE_ACCOUNT_PROJECT_ID,
credentials: {
client_email: process.env.GOOGLE_SERVICE_ACCOUNT_CLIENT_EMAIL!,
private_key: process.env.GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY!,
},
}),
],
};
}
function serverConfig(): LoggerOptions {
return {
transports: [
new transports.Console({
level: process.env.LOG_LEVEL || 'info',
debugStdout: true,
format: format.combine(format.splat(), format.simple()),
}),
],
};
}
If I have a custom element and use the DOM remove()
function on it, will the unbind()
and detached()
lifecycle hooks on its view-model be called? For example
const myCustomElement = document.querySelector('#myCustomElement');
myCustomElement.remove()
I'm trying to track down whether I'm doing this incorrectly or if I should not expect those lifecycle hooks to be called when an element is removed from the DOM in this way.
I can confirm that those lifecycle hooks get called when the element is in a route and I navigate away from the route.
@processContent(...)
decorator within which I'm trying to register a custom component (like this example in the docs https://aurelia.io/docs/templating/custom-elements#decorators-for-customizing-aurelia-custom-element-processing sandbox link https://codesandbox.io/s/p7wo71qrzj?from-embed )
resources.registerElement(
"icon-list-item",
instruction.type["viewFactory"].resources.getElement("icon-list-item")
);
ERROR [templating] TypeError: Cannot read property 'resources' of undefined
viewFactory
can be undefined in a @processContent(...)
handler?
[HttpGet("{id:int}")]
. Having something like that would take care of it or being able to define a regex for a route param would also take care of it.