Access BlockList alias from Block

Hello!

Is there any way to access or extract the alias of the BlockList that a block is inside?
I have a document that has 5 tabs and in every tab i have a BlockList of the same type, and have created a custom view for the blocks inside it like this.

What i want to do is to check the alias of the BlockList, so i can style them a little different depending on the BlockList the block is inside.
The aliases of the BlockLists are “pistsGreen“, “pistsBlue“, “pistsRed“ etc…

I tried getting it in the angular controller for the block view but couldn’t find a way to do it.
Then i tried creating a NotificationHandler to set a property on save to the alias of the BlockList it is in, but wasn’t able to find a good solution for that either.
Getting the parent of a block returns the root node of the entire content tree, event though the BlockList is on a content node 3 levels down…
You would expect it to return either the BlockList or the content node the BlockList is on.

Does blocks have no relation to the BlockList or the content node it’s on, or am i missing something?

I assume your using Umbraco 13 and AngularJs, if so not sure if the below helps as different versions have me different outcomes:

angular.module(“umbraco”).controller(“myBlockController”, function($scope) {// Traverse up the scope chain to find the parent property aliaslet parentScope = $scope.$parent;while (parentScope && !parentScope.model?.alias) {parentScope = parentScope.$parent;}
if (parentScope?.model?.alias) {
    $scope.parentAlias = parentScope.model.alias;
}
});

Then in your view

Block is inside: {{ parentAlias }}

This assumes your block view is nested within a scope that eventually leads to the property editor model.

Aah yes!
I tried something similar but must have missed something earlier.
That solution works great.
Thank you!