What is the Order of Events Between ASP.NET of JavaScript

Trying to understand order of events, variable settings, property settings, etc… between ASP.NET and JQuery/JavasSript. I show a basic, snipped example below to try to explain my question.

In ASP.NET code-behind I created both a public property and variable (to catch any differences) which values are set during the Page Load event. Then a script from the front of the page, I retrieve the values from the ASP.NET property and variable inline, within my jQuery/JavaScript code and write it to the console.

My intention for this in my real project is to retrieve values from ASP.NET that I can pass on to JavaScript. This works, but I’m not clear why. I thought client-side scripts ran before server-side scripts, so how do these values get picked up? How do I determine the order of everything?

ASP.NET page:

<%@ Page Language="VB" ... blah ... %>
<!doctype html>
<html lang="en">
<head runat="server">
    <title>My ASP.NET Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <p>Basic Example</p>
    </form>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" ...blah...></script>
    <script>
        $(document).ready(function () {
            console.log("MyAspnetProperty = " + "<%= MyAspnetProperty %>");
            console.log("MyAspnetVariable = " + "<%= MyAspnetVariable %>");
        });
    </script>
</body>
</html>

My code behind

Partial Class my_aspnet_page
    Inherits System.Web.UI.Page

    Public Property MyAspnetProperty As String
    Public MyAspnetVariable As String

    Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        MyAspnetProperty = "ASP.NET Property Value"
        MyAspnetVariable = "ASP.NET Variable Value"
    End Sub
End Class

How to restore separate month navigation controls for each month when using months={2} in react-date-range

I am using the react-date-range library to implement a date range picker with two calendars. The expected behavior is that both calendars should be independent of each other on the UI, with separate month navigation. Users should be able to select the start and end date from either calendar at any time.

However, with the latest version, there is only one month/year navigation at the top, and both calendars are shown side by side. The month navigation option at the top affects both calendars simultaneously, which is not the desired behavior. It currently shows the immediate next month to the option selected at the top.

How can I achieve independent month navigation for each calendar?

import { DateRange } from 'react-date-range';
  <DateRange
      ref={(c) => {
        if (c) {
          this.dialog = c;
        }
      }}
      direction="horizontal"
      months={2}
      showDateDisplay={false}
      onChange={this.onRangeChange}
      fixedHeight={true}
      ranges={[
        {
          startDate: this.state.range.startDate,
          endDate: this.state.range.endDate,
          key: 'selection',
        },
      ]}
      locale={locale}
  />

Current behaviour:
enter image description here

How to remove Israel from google maps [closed]

I’m using Google Maps for drawing routes, I see Israel on the map, is there any way to remove it or replace it with Palestine?

async function mapInit() {

mapLoader = new MapLoader('@ViewData["MapType"]', [''],@ViewData["Lat"],@ViewData["Lng"], '@ViewData["ApiKey"]', '@ViewData["Region"]');
map = await mapLoader.getMap();

historicalRoutesManager = new HistoricalRouteManager(map);
drawRoutesManager = new DrawRouteManager(map);
infowindow = new google.maps.InfoWindow({
    pixelOffset: new google.maps.Size(0, 303),
});

// Close the infowindow when clicking on the map.
google.maps.event.addListener(map, "click", function (e) {
    infowindow.id = null;
    infowindow.tenantId = null;
    infowindow.close(map, this);
    isOpened = false;
});

}

enter image description here
enter image description here

Prevent Customer without Postcode/Zip from Checking out in Shopify [closed]

I am not sure what I am doing wrong, I am working on a shopify extension that prevent user from checking out unless the postcode is entered. This prevent be user from checking out whether the postcode is entered or not

export function run(input) {
  const errors = [];

  // Define localized messages for different languages
  const translations = {
    EN: "Postcode is required for checkout.",
    FR: "Le code postal est requis pour le paiement.",
    DE: "Die Postleitzahl ist für den Checkout erforderlich.",
    NL: "Postcode is vereist voor de checkoutffff."
  };

  // Default to English if the locale is not supported
  const locale = input.localization.language.isoCode || "EN";
  const errorMessage = translations[locale] || translations["EN"];

  console.log(input.localization.language.isoCode)
  console.log(input.cart.deliveryGroups)

  // Check if the postcode is missing or null
  const missingPostcode = input.cart.deliveryGroups.some(
    (group) => !group.deliveryAddress?.postalCode
  );
  console.log(missingPostcode)
  if (missingPostcode) {
    errors.push({
      localizedMessage: errorMessage,
      target: "$.cart.deliveryGroups[0].deliveryAddress.postalCode",
    });
  }

  return {
    errors,
  };
}

This is the error I get from when the postcode is null
enter image description here

This is what I get when the postcode has value
enter image description here

My graphQL is

query RunInput {
  cart {
    deliveryGroups {
      deliveryAddress {
        zip,
        countryCode
      }
    }
  }
  localization {
    language {
      isoCode
    }
  }
}

What could be syntax or wrong in this code? [closed]

I am building a customized Playlist video player and the videos in the directory is not fetched and it shows that there some syntax in the following code

Here is the code. It is only part of the main scipt code has syntax as the console shows

async function fetchVideos() {
    try {
        const response = await fetch('get_videos.php');
        if (!response.ok) {
            throw new Error('Failed to fetch videos');
        }
        playlist = await response.json();
        console.log('Fetched videos:', playlist); // Debugging: Log fetched videos
        renderPaginatedPlaylist(playlist, currentPage);
    } catch (error) {
        console.error('Error fetching videos:', error);
    }
}

Doc not found in firebase

I am building a simple chat app and this code runs when I click on the user and select it. It should update user state, but it works wrong. For example, I have 2 users: User1, User2. When I select User1, the error appears as “User not Found”, then I select User2 the same happens. After that no matter what I select, all works ok and the user found.

Code:

const [user, setUser] = useState(null);
const [err, setErr] = useState(false);

const q = query(collection(db, "users"), where("displayName", "==", username));
try {
  const querySnapshot = await getDocs(q);
   querySnapshot.forEach((doc) => {
    const userData = doc.data();
    setUser(userData);
    });
  } catch (err) {
    setErr(true);
  }

if (!user) {
  console.error("User not found");
  return;
}

console.log("User found:", user);`

I am a beginner, but I think it’s related to asynchrony

How do I reactivate my Comcast email? [Comcast Support]

**Who do I contact if my Comcast email is not working?

If your Comcast email is not working, you can reach out to Comcast customer support. Dial USA +(1)-866-203-9444 or UK +(44)-2035-350379 for assistance. Their representatives will help you troubleshoot email issues, recover account access, or address technical problems. Be sure to have your account details ready for quicker service. Support is available Monday through Friday during business hours.
**

**Who do I contact if my Comcast email is not working?

If your Comcast email is not working, you can reach out to Comcast customer support. Dial USA +(1)-866-203-9444 or UK +(44)-2035-350379 for assistance. Their representatives will help you troubleshoot email issues, recover account access, or address technical problems. Be sure to have your account details ready for quicker service. Support is available Monday through Friday during business hours.**

How do I get a function component to rerender when a state var changes?

I’m new to React and React hooks and very confused about how to trigger a re-render when a state variable changes and I have a useEffect that monitors that state.

Is it possible to trigger renderFileItems to rerun? It is called using {renderFileItems(files)} in the returned html. While I do see useEffect being called I’m not sure how to trigger the re-render for that area, I’m also ok with full re-render of the page but not sure how to trigger that either.

export default function FileUpload() {
  const [files, setFiles] = useState();

  useEffect(() => {
    // what do I do here?
    console.log("CHANGE"); // I do see this getting printed when I add a file
  }, [files, fileStatus]);

  const remove = (filename) => {
    if (files == undefined) {
      return;
    }
    var i = 0;
    while (i < files.length) {
      if (files[i] === filename) {
        files.splice(i, 1);
      } else {
        ++i;
      }
    }
    setFiles(files);
  };

  const renderFileItems = (filelist) =>
    filelist == undefined ? (
      <></>
    ) : (
      filelist.map((f) => (
        <li className="flex" key={f}>
          {f}
          <button onClick={remove(f)}>
            <TrashIcon
              aria-hidden="true"
              className="inline-block align-middle size-5 shrink-0"
            />
          </button>
        </li>
      ))
    );

  const fileHandler = (filesArg) => {
    // does some logic with filesArg then updates Files state var.
    setFiles(/*transformed filesArg*/);
  };

  return (
    <AppLayout>
      <div className="flex flex-col">
        <div className="flex items-center justify-center w-full items-center justify-center w-full pr-24 pl-24 pt-12">
          <label
            id="drop-zone"
            className="flex flex-col items-center justify-center w-full h-32 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 hover:bg-gray-100 border-gray-300"
            onDragOver={dragOverImageChange}
            onDragLeave={dragLeaveChange}
            onDrop={dropHandle}
          >
            <div className="flex flex-col items-center justify-center pt-5 pb-6 gap-y-2">
              <p className="mb-2 text-md text-black font-semibold">
                Click to upload or drag and drop
              </p>
              <input
                id="dropzone-file-input"
                type="file"
                className="hidden"
                onChange={fileSelectedHandler}
                accept=".csv"
                multiple="True"
              />
            </div>
          </label>
        </div>
        <div className="flex py-12 w-full mx-auto pl-24">
          <ul
            className="flex flex-col gap-y-1 justify-stretch items-stretch font-semibold text-gray-600"
            id="files-show"
          >
            {renderFileItems(files)}
          </ul>
        </div>
      </div>
    </AppLayout>
  );
}

If I have to split out the renderFileItems as its own component, I am confused how to have it call the remove() function which will have to modify the files state var tracked in the parent component.

Thanks for any help!

Using Levenshtein distance to compute HTML diff

I am using Levenshtein distance to compute the differences between 2 HTML strings. Given 2 HTML strings:

  1. They are first converted to DOM objects
  2. Both the DOM objects are flattened into 2 separate arrays
  3. It is fed into the Levenshtein distance algorithm.

But the problem is, that it does not always compute the most optimal diff. By optimal, I mean the one that is visually more correct. For example:

const oldHTML = `<div>
    <div>
        <ul>
        <li>x</li>
        </ul>
    </div>
</div>`;

and

 const newHTML = `<div>
    <div>
        <ul>
        <li>x</li>
        </ul>
    </div>
    <div>
        <ul>
        <li>xy</li>
        </ul>
    </div>
</div>`;

must produce the diff:

        <div>
        <div>
            <ul>
                <li><span class="diffMark inserted ">xy</span></li>
            </ul>
        </div>
        <div>
            <ul>
                <li>x</li>
            </ul>
        </div>
        </div>

but rather it produces:

        <div>
        <div>
            <ul>
                <li><span class="diffMark inserted ">xy</span><span class="diffMark removed ">x</span></li>
            </ul>
        </div>
        <div>
            <ul>
                <li><span class="diffMark inserted ">x</span></li>
            </ul>
        </div>
        </div>

which is not incorrect but not the most optimal.

Here is how the matrix construction and its traversal is happening:

    var
      diff = [],
      row = old.length + 1,
      column = current.length + 1,
      offset = 1

    function createMatrix() {
      matrix = new Array(row);
      for (var i = 0; i < row; i++) {
        matrix[i] = new Array(column);
      }
      //fill the 0th row and column
      for (var i = 0; i < row; i++) {
        matrix[i][0] = i;
      }
      for (var j = 0; j < column; j += 1) {
        matrix[0][j] = j;
      }
      //calculate min operations
      for (var i = 1; i < row; i++) {
        for (var j = 1; j < column; j++) {
          var a = old[i - offset];
          var b = current[j - offset];
          var subDistance = (a.hashVal == b.hashVal) ? 0 : 10e6;
          var costReplace = matrix[i - 1][j - 1] + subDistance * a.elementCount + subDistance * b.elementCount;
          var costRemoved = matrix[i - 1][j] + a.elementCount;
          var costInserted = matrix[i][j - 1] + b.elementCount;
          matrix[i][j] = Math.min(costReplace, costRemoved, costInserted);
        }
      }
    }


    function traceBack() {
      var i, j;

      for (i = row - 1, j = column - 1; i > 0 && j > 0;) {
        var top = matrix[i - 1][j];
        var topLeft = matrix[i - 1][j - 1];
        var left = matrix[i][j - 1];
        if (topLeft == matrix[i][j] && topLeft <= top && topLeft <= left) {
          current[j - offset].status = 'unchanged';
          diff.unshift(current[j - offset]);
          i--;
          j--;
        }
        else if (top < matrix[i][j]) {
          (old[i - offset]).status = 'removed';
          diff.unshift(old[i - offset]);
          i--;
        }
        else if (left < matrix[i][j]) {
          (current[j - offset]).status = 'inserted';
          diff.unshift(current[j - offset]);
          j--;
        }

      }

      while (i > 0) {
        (old[i - offset]).status = 'removed';
        diff.unshift(old[i - offset]);
        i--;
      }
      while (j > 0) {
        (current[j - offset]).status = 'inserted';
        diff.unshift(current[j - offset]);
        j--;
      }
    }

I am looking for a solution and a perspective to look at this problem. What I have observed is:

  • The Levenshtein algorithm in its traceback is picking the path that is not incorrect. But in the same matrix there exists a path, that will produce a better output as I showed above. How can this be approached?

Is there a way to explore all possible paths and choose the one?

Please let me know, if I missed adding more information.

Second JavaScript object that contains WebSocket connection is not connecting properly. What have I done wrong?

I’m working on a web-based dashboard to control a series of laboratory instruments. Each instrument, when connected to my computer via USB, has a WebSocket interface that allows me to read data from the instrument. Since I want to connect any number of instruments to dashboard, I made an instrument object in JavaScript that looks like this:

class instrument {
    constructor(id, name, model, ws_connection) {
        super(id, name, model);

        this.connection_point = ws_connection;

        this.extra_info = {
            isConnected: false
        }
        

    }

    async connect() {
        this.socket = new websocket('ws://'+this.connection_point+':6402');
        this.socket.onmessage = this.onMessage.bind(this);
        this.socket.onopen = this.onOpen.bind(this);
        this.socket.onclose = this.onClose.bind(this);
        this.socket.onerror = this.onError.bind(this);
        
        await new Promise((resolve, reject) => {            
            this.socket.onopen = resolve;
            this.socket.onerror = reject;
        });

        this.extra_info.isConnected = true;

    }

    onMessage(event) {
        //Code that handles data        
    }

    onOpen(event) {
        this.extra_info.isConnected = true;
    }

    onClose(event) {
        this.extra_info.isConnected = false;
    }

    onError(event) {
        console.log(event);
    }

    //Other code here handles the data processing
}

I realized that when working on my dashboard that if I had one instrument connected, I don’t have any issues. However, when I try to connect two instruments, the second instrument gets hung up.

For example, if this was my index.js:

const websocket = require('ws');
const instrument = require("./api/instrumentClass");

const myInstrument1 = new instrument(1, 'test', 'test', '1.1.1.1');

myInstrument1.connect().then(e => {
                    
    console.log("1: Connected");

}).catch((e) => {
    console.log("1: Error");
});

const myInstrument2 = new instrument(1, 'test', 'test', '2.2.2.2');

myInstrument2.connect().then(e => {
                    
    console.log("2: Connected");

}).catch((e) => {
    console.log("2: Error");
});

and both myInstrument1 and myInstrument2 are connected to my computer, “1: Connected” will appear in the console and then after 20 seconds I’ll get “2: Error” in the console. I’d like to have it so that I can make any number of “instrument” objects from my dashboard, so I don’t want to hardcode instruments into the dashboard.

I don’t have a computer science background but have some experience from my thesis work, so I apologize if the issue is trivial or if my code is sloppy. I’m really new to WebSockets so I’m not sure quite what I’ve done wrong. I’d appreciate any advice on how to fix this issue!

When I make a TLS LDAP connection in Node.js what parameter should I include?

Here is my code:

import ldap from 'ldapjs';
try {
      let config = {
        .......................  
        tlsOptions: { 
           cert : [fs.readFileSync("host.cer")],
           ca: [fs.readFileSync("CA.cer")],
        },
         ...........
     }
       this.#client = ldap.createClient(config);
    } catch (error) {
        throw error
    }

I found that if I remove the “cert” attribute from the “tlsOptions” object,
the program is still working properly.

However, if I remove the “ca” attribute from the “tlsOptions” object, the program will not work any more.

So, should I include the “cert” attribute in the “tlsOptions” object?

What is the reason the program works properly, if I include “CA” attribute only?

Silence some “helper” functions from the stack trace

I’m working on some algorithms that explore a tree (via recursion) to inspect and transform it. I’m using a number of helper functions to recurse: they validate input and output data, log stuff, handle some exceptions and so on and so forth.

When there’s an error, I rely on the stack trace to figure out what’s happening and fix it. However the stack trace is polluted by those recursion helper.

Here a minimal example (uncorrelated to my program) that shows the issues with the stack trace pollution:

function sum(list) {
  if (list.length===0) { throw new Error("not yet implemented"); }
  const [head, ...tail] = list;
  return helper1(()=>{
    return head + sum(tail);
  });
}

function helper1(f) {
  try {
    return helper2(f);
  } catch(e) {
    // here I'm supposed to try to handle the error
    throw e;
  }
}

function helper2(f) {
  // here I'm supposed to increase indentation for loged messages...
  const r = f();
  // ...and now decrease it
  return r;
}

try {
  console.log(sum([7, 2, 3, 8]));
} catch(e) {
  console.error(e.stack);
}

For each recursive call to sum, the stack trace contains additional calls to helper1, helper2 and the closure passed to helper1 by sum. In the case of my program, I have 8 of those functions polluting the stack trace for every recursive step.

Is there any way to silence or hide those helper functions from the stack trace?

How to display data based on a drop-down selection populated by a SQL query?

the issue I have at hand is that I need to load data from a SQL query using PHP into a drop-down menu, have a person select one of those items which will then show more information based on that selection, and then upload that plus some other options based on that selection to another table. The Submit button will include posting values based on the Drop-down selection.
I am a returning newbie, not having written a web page in about 20 years. I’ll tell ya, you casually mention to your boss that you once used to make general websites….

Basically, I need to do my SQL query, list one field in a drop-down box, but then have other items (div,

, forms, etc…) display data based on that drop-down selection. In short, I need to have all the data available.

So, here’s the HTML/PHP side:

<?php
$getParts = $con->query("SELECT * FROM allparts");
?>

<form action = "addParts.php" class = "form-main" method = "POST">
                <label for = "partName">Part Name:  </label>
                <select name = "partName" id = "partDescription" onchange="dropDownChange()">
                    <option value = "">Please Select...</option>
                    <?php
                    while ($rows = $getParts->fetch_assoc())
                    {
                        $partName = $rows["partName"];
                        $partID = $rows["id"];
                        $partDescription = $rows["partDescription"];
                        echo "<option value = '$partName'>$partName</option>";
                    }
                    ?>
            </select>
            <button type = "submit" value = "submit">Submit</button>
            </form>   

        <div id = "desc-div"></div>
        <div id = "desc2-div"></div>

And here’s the JavaScript side:
edit Do I even need a JavaScript side… can I do it all in PHP?
edit2 The following javascript won’t work the way I want it to, but it is what I have currently. It is two options I tried before realizing a built-in problem w/ my prior While loop.

<script type = "text/javascript">
            const displayDesc = document.getElementById('partDescription');
            displayDesc.addEventListener('change', function() 
            {
                const sDesc = document.getElementById('desc-div');
                sDesc.innerHTML = '<?php echo "$partDescription";?>';
            })

            function dropDownChange()
            {
                var text = document.getElementById("desc2-div");
                var e = document.getElementById("partDescription");
                var strText = e.options[e.selectedIndex].value;
                text.innerHTML = strText;
            }
        </script>

I understand that the While loop will just list the partName line by line, and forget about the line before it. I wonder if I need to run a 2nd SQL query based on the selection. So the 1st query fills the drop-down box, and the 2nd query will get the rest of the information based on what I have selected. Or am I missing something simple?

Component is missing template or render function, issue with router

This was working, but then I added ts to vue, and got into next problem:

My router.ts :

import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import TicketsList from './../pages/TicketsList.vue'
import UserCart from './../pages/UserCart.vue'

const routes: Array<RouteRecordRaw> = [
  { path: '/', redirect: '/tickets' },
  { path: '/tickets', component: TicketsList },
  { path: '/cart', component: UserCart },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router

And my component:

<template>
  <div class="container mt-5">
    <div class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4">
      <div v-for="(ticket) in tickets" :key="ticket.id" class="col">
        <ticket-item
            :id="ticket.id"
            :title="ticket.eventName"
            :image="ticket.imagePath"
            :date="ticket.date"
            :ticketType="ticket.ticketType"
            :price="ticket.price"
        ></ticket-item>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, computed } from 'vue';
import { useStore } from 'vuex';
import TicketItem from '../components/tickets/TicketItem.vue';
console.log(111);
const store = useStore();

const tickets = computed(() => store.getters['ticket/tickets']);

onMounted(() => {
  console.log(store);
  store.dispatch('ticket/getTickets');
  store.dispatch('cart/getCart');
});
</script>

My app.ts:

import {createApp} from 'vue';
import App from './App.vue';
import {createStore} from "vuex";
import router from "./router";
import Tickets from "./components/store/tickets";
import Cart from './components/store/cart';

const app = createApp(App);
const store = createStore({
    modules: {
        ticket: Tickets,
       cart: Cart,
    },
});

app.use(router);
app.use(store);
app.mount('#app');

No sure what is wrong, got this error in vue devtools nothing in console.
Is somebody able to help please?
Also using webpack, but dont think this has anything with it.

New subscriptions always returning intial value instead of current value

I have a relatively simple Angular app using services to pass values between my components. The problem I am running into is when I go to a new route and load a component, subscribe to a service, it is always returning the intial value of instead of teh current value.

The main app.component has a component for a menu and then a router-outlet to load components based on the route when the user clicks a menu item. I have a service that is subscribed to and updates the current selected menu item in the menu component. The other components subscribe to the same service to get the current menu item, but they always just get the initial value, not the current value when subscribing to the service. The subscription in the menu component is always updated corectly and gets the correct values.

menu component:

@Component({
    selector: 'app-menu',
    templateUrl: './menu.component.html',
    styleUrls: ['./menu.component.scss'],
    providers: [MenuDatabase, NavigationService],
    standalone: false
})
export class MenuComponent implements OnInit {

  @Input() treeControl = new NestedTreeControl<MenuItem>(node => {
    return (node.models) ? node.models : node.actions;
  });

  public activeItem:  MenuItem | undefined;
  public versionList: Version[] = [];
  public menuItemList: MenuItem[] = [];
  public currentVersion: string = '';
  public isSearching: boolean = false;
  public searchForm = new UntypedFormGroup({ search: new UntypedFormControl('') });

  hasChild = (_: number, node: MenuItem) =>
    (!!node.models && node.models.length > 0) ||
    (!!node.actions && node.actions.length > 0);

  dataSource = new MatTreeNestedDataSource<MenuItem>();

  constructor(
    public router: Router,
    public menuService: MenuService,
    private navigationService: NavigationService,
    private database: MenuDatabase,
  ){
    navigationService.activeMenuItem$.subscribe(
      item => {
        this.activeItem = item;
      }
    )
  }

  ngOnInit(): void {

  }

  navigate(menuItem: MenuItem) {
    if(menuItem.models)
      this.router.navigate([`${this.currentVersion}/module/${menuItem.code}`], { state: { ep: menuItem } });
    if(menuItem.actions)
      this.router.navigate([`${this.currentVersion}/model/${menuItem.code}`], { state: { ep: menuItem } });
    if(!menuItem.actions && !menuItem.models)
      this.router.navigate([`${this.currentVersion}/action/${menuItem.code}`], { state: { ep: menuItem } });
    this.navigationService.setActiveMenuItem(menuItem)
}

navigationService:

@Injectable({
  providedIn: 'root'
})
export class NavigationService {

  private defaultItem = {
    title: "Home",
    code: "home"
  }
  // Observable string sources
  private activeMenuItemSource = new BehaviorSubject<MenuItem>(this.defaultItem);

  // Observable string streams
  activeMenuItem$ = this.activeMenuItemSource.asObservable();

  constructor(){
    }

  // Service message commands
  setActiveMenuItem(activeItem: MenuItem) {
    console.log("from: " + this.activeMenuItemSource.getValue().title + " | to: " + activeItem.title)
    this.activeMenuItemSource.next(activeItem);
  }

The console.log in theh service always shows what I would expect when the setActiveMenuItem() method is called from the menu component.

Component loaded when navigate() is called:

@Component({
    selector: 'app-action-page',
    templateUrl: './action-page.component.html',
    styleUrls: ['./action-page.component.scss'],
    standalone: false
})
export class ActionPageComponent implements OnInit {

  @Input() treeControl = new NestedTreeControl<MenuItem>(node => {
    return (node.models) ? node.models : node.actions;
  });

  @Input() menuItem: MenuItem;

    constructor(
    private activatedRoute: ActivatedRoute,
    private actionService: ActionService,
    private navigationService: NavigationService
  ) {
  };


  ngOnInit(): void {
    this.activatedRoute.url.subscribe(seg => {
      this.version = seg[0].path || '';
      this.level = seg[1].path || '';
      this.itemCode = seg[2].path || '';

      this.actionService.getAction(this.itemCode)
          .subscribe(data => {
            this.item = data
          })

    });

    this.navigationService.activeMenuItem$.subscribe(
      item => {
        console.log(item)
      }
    )
  }

The console log in the ActionPageComponent always shows ‘Home’ (the inital value for the BehaviorSubject Observable)

How do I get the components loaded in the router-output to subscribe to the service while rtaining the current values from that service?