Clean css components. Looks great. Requires tailwind css installed.
daisyui.com/
Author: Andreas Plahn
Send mails using NodeJS
Angular – How to force reload components with router navigation
(Tested in Angular 11 project)
One trick is to “double” navigate to force components to destroy and “update” their lifecycle.
E.g.:
/// Navigates to detail view
navigateToDetail(id: string) {
// Navigates to start page first to "destroy" detail components if on same url
this.router.navigate(['/']).then(() => {
// Then navigates to desired url
let navigationExtras: NavigationExtras = { queryParams: { 'id': id} };
this.router.navigate(['/view'], navigationExtras);
});
}
I also added this to app-routing.module.ts: (not sure if it makes a difference with the above code)
@NgModule({
imports: [RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload',
})],
exports: [RouterModule],
})
export class AppRoutingModule {}
Angular component navigation doesn’t work anymore in Webstorm IDE
Please try invalidating caches (File | Invalidate caches, Invalidate and restart) – does the problem persist? Do you have @angular node_modules installed and included in project?
Also try reinstall npm packages:
npm install
TaskbarX | Center taskbar icons
Windows 10 Taskbar utility – Windows 11 alike style taskbar witch icons in center.
TaskbarX TaskbarX gives you control over the position of your taskbar icons. TaskbarX will give you an original Windows dock like feel. The icons will move to the center or user given position when an icon gets added or removed from the taskbar. You will be given the option to choose between a variety of different animations and change their speeds. The animations can be disabled if you don’t like animations and want them to move in an instant. The center position can also be changed to bring your icons more to the left or right based on the center position. Currently all taskbar settings are supported including the vertical taskbar. And Unlimited taskbars 🙂
Source: TaskbarX | Center taskbar icons
How to force Angular to reload components when navigating to same url
Tested in Angular 11:
In module config for route module:
@NgModule({
imports: [RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload',
})],
exports: [RouterModule],
})
Set onSameUrlNavigation to ‘reload’
Whan using router.navigate() force url to update by adding a unique query parameter:
let navigationExtras: NavigationExtras = {
queryParams: {
refreshToken: (new Date).getTime(); //pass a dummy parameter (i.e. the time in milliseconds since 1970 or use the npm uuid library), forces reload of unique url
},
};
this.router.navigate(['/detail'], navigationExtras);
More info:
https://github.com/angular/angular/issues/13831
7 Best Angular Component Libraries to use in 2020 – DEV Community 👩💻👨💻
Angular 10+ Strict Mode
From Angular 10 (experimental) / 11 (default on create new app) you can get strict mode. In summary it reduces the bundle size (by 75%!) and increases the maintainability by disabling you to create objects of type ‘any’ (no untyped types)…
Angular 11+ CLI creates all new workspaces and projects with strict mode enabled.
Strict mode improves maintainability and helps you catch bugs ahead of time. Additionally, strict mode applications are easier to statically analyze and can help the
ng updatecommand refactor code more safely and precisely when you are updating to future versions of Angular.Specifically, strict mode does the following:
-
Enables
strictmode in TypeScript, as well as other strictness flags recommended by the TypeScript team. Specifically,forceConsistentCasingInFileNames,noImplicitReturns,noFallthroughCasesInSwitch. -
Turns on strict Angular compiler flags
strictTemplates,strictInjectionParametersandstrictInputAccessModifiers. -
Bundle size budgets have been reduced by ~75%.
More info:
https://angular.io/guide/strict-mode
Angular CLI Strict Mode. In Angular, we strongly believe in… | by Minko Gechev | Angular Blog
Pomotroid – pomodoro timer
A Simple, Configurable and Visually Pleasing Pomodoro Timer
Source: Pomotroid – A Simple, Configurable and Visually Pleasing Pomodoro Timer
Typescript debug util – Output json structure to console as formatted and sorted properties
Made a Debug util TypeScript class for formatted output to browser console of json objects, also sorted on property keys alphabetically (usage: simplifies text compare between different json structures).
export class DebugUtils {
///Outputs object as formatted json string to console.
public static ToConsoleJson(value: any, message = null) {
if (message) {
console.log(message);
}
console.debug(JSON.stringify(value, null, 2));
}
///Outputs object as formatted json string to console sorted alphabetically by property keys.
public static ToConsoleJsonSortedByKey(obj: any, message = null) {
//sort object keys alphabetically
var allKeys = [];
JSON.stringify( obj, function( key, value ){ allKeys.push( key ); return value; } )
allKeys.sort();
const sortedJsonString = JSON.stringify( obj, allKeys, 2);
if (message) {
console.log(message);
}
console.debug(sortedJsonString);
}
}