Angular event instanceof NavigationEnd

by Arron McCrory

1 min read

I had a line of code that looked like let last = event.url.split("/").pop();

I usually use event.url whenever I subscribe to this.router.events.subscribe((event)

but I realized that I should be using event.urlAfterRedirects

Here is the full story.

When I was testing my code it worked whenver I went directly to the URL in question. event.url would get the 'model-home' that I was expecting. However it would not work if I navigated to the page in question. The route I would navigate to is /vehicle/:id , and this is due to redirects...

My Route file looks like this { path: "", redirectTo: "model-home", pathMatch: "full" }, { path: "model-home", component: VehicleHomeComponent, },

By having a redirect in my Router the event now has the urlAfterRedirects property url: "/list/098f1ebd9f35/vehicle/22839" urlAfterRedirects: "/list/098f1ebd9f35/vehicle/22839/model-home"

Continue reading →

Web Icons & Icon Fonts

by Arron McCrory

1 min read

Office UI Fabric icons

https://uifabricicons.azurewebsites.net/

I like this library due to its very sharp edges and mostly uniform sizing across all the icons.

The list of available icons is quite extensive, but not every icon looks good together.

Feather Icons

https://feathericons.com/

This library has nice soft rounded icons, and they all seem to follow the same exact design philosophy. Every icon looks good together, but the amount of icons is 287.

Font Awesome

https://fontawesome.com/search?m=free&o=r

Even if you aren't aware of icon libraries, odds are you have seen theses icons before. This was one of the original font libraries and are still going strong to this day.

I personally have been venturing away from the use of this library over the last few years due to new options popping up pretty much everywhere.

The icons don't always match up with eachouther, but my expereince has only been with the free version, perhaps the pro version has a better selection.

Continue reading →

Don't waste your creative energy

by Arron McCrory

1 min read

So you are a software developer, artist, creative.

You have great ideas and would love to see your ideas come to life in the workplace.

You want to build, you want to create!

Yet the company you work for doesn't see eye to eye with your vision.

You get frustrated.

you get burnt out.

There is a very simple strategy to not feeling this way.

Ready?

Stop.

Stop trying to implement the new ways of doing things, your new ideas, your creativity.

But, don't stop it entirely!

Just stop doing it at your job.

Some jobs encourage creativity and new solutions, and some jobs do not.

Instead of wasting your energy trying to move a rock that won't move, start using your creativity in a different project.

Create something brand new. Creativity is a terrible thing to waste, so don't waste it.

If you are going to use your creative energy use it for something you can be proud of, something that is yours. Something that is entirely your idea.

Continue reading →

More posts can be found in the archive.