Upgrade quasar – ReferenceError: process is not defined

I have a old project and I try to update this (quasar 1 to 2)
here the version I use:

at this point I have an error in my console from my browser:

Uncaught ReferenceError: process is not defined
    at eval (index.js:7:1)
    at ./src/router/index.js (app.js:282:1)
    at __webpack_require__ (app.js:1487:32)
    at fn (app.js:1785:21)
    at eval (app.js:23:79)
    at ./.quasar/app.js (app.js:19:1)
    at __webpack_require__ (app.js:1487:32)
    at fn (app.js:1785:21)
    at eval (client-entry.js:239:67)
    at ./.quasar/client-entry.js (app.js:30:1)

I tried to understand what Is missing but I’m a little lost

I post also the actual package.json:

"dependencies": {
    "@quasar/app-webpack": "^3.13.4",
    "@quasar/babel-preset-app": "^2.0.3",
    "@quasar/extras": "^1.16.12",
    "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.16",
    "@vue/compat": "^3.5.4",
    "@vuex-orm/core": "^0.36.4",
    "apexcharts": "^3.53.0",
    "axios": "^1.7.7",
    "encoding-japanese": "^2.2.0",
    "js-md5": "^0.8.3",
    "jwt-decode": "^4.0.0",
    "lodash.isequal": "^4.5.0",
    "moment": "^2.30.1",
    "quasar": "^2.16.11",
    "stylus-loader": "^8.1.0",
    "vue": "^3.5.4",
    "vue-apexcharts": "^1.6.2",
    "vue-avatar": "^2.3.3",
    "vue-i18n": "^10.0.0",
    "vuex": "^4.1.0"
  },
  "devDependencies": {
    "@babel/eslint-parser": "^7.25.1",
    "@eslint/compat": "^1.1.1",
    "@eslint/js": "^9.10.0",
    "@quasar/icongenie": "^4.0.0",
    "@vue/babel-preset-app": "^5.0.8",
    "autoprefixer": "^10.4.20",
    "eslint": "^8.0.1",
    "eslint-webpack-plugin": "^4.2.0",
    "eslint-plugin-vue": "^9.28.0",
    "eslint-plugin-html": "^8.1.1",
    "eslint-plugin-import": "^2.30.0",
    "globals": "^15.9.0",
    "quasar-app-extension-ide-helper": "1.0.2"
  },
  "engines": {
    "node": ">= 22.7.0",
    "npm": ">= 10.8.2",
    "yarn": ">= 1.22.22"
  },
  "browserslist": [
    "last 1 version, not dead, ie >= 11"
  ]

I have another error in the console maybe I don’t know if this have side effects or not but:

[Vue warn]: Failed to mount app: mount target selector "#app" returned null.

Sorry if the information is confuse, I’m also confuse where I need to check

How can I use image as markers?

I am using an area chart from ApexCharts. Now I want to use a custom marker and show some images as markers. How can I do those things?

// finance page area chart

It was the path of images..
const imageUrls = [
  './assets/images/icon/ETH-2.png',
  './assets/images/icon/ETC.png',
  './assets/images/icon/BTC.png',
  './assets/images/icon/LTC.png'
];


  markers: {
    size: 10, // Adjust marker size
    strokeColors: '#FFFFFF',
    strokeWidth: 2,
    hover: {
      size: 35, // Size of marker on hover
    },
    custom: {
      images: imageUrls.map((url, index) => ({
        src: url,
        width: 30, // Adjust width based on your image size
        height: 30 // Adjust height based on your image size
      })),
      // Function to set the correct image for each data point
      fillColor: function (dataPointIndex) {
        return imageUrls[dataPointIndex % imageUrls.length];
      }
    },
  },
  tooltip: {
    enabled: false,
  },
  xaxis: {
    labels: {
      show: true, // Show x-axis text labels
    },
    axisBorder: {
      show: false, // Hides the x-axis border/line
    },
    axisTicks: {
      show: false, // Hides the x-axis ticks
    },
  },
  yaxis: {
    min: 0,
    max: 70,
    tickAmount: 7,
    labels: {
      show: true, // Show y-axis text labels
    },
    axisBorder: {
      show: true, // Show the y-axis border
      color: "#1F2336", // Change the y-axis border color
    },
  },
  grid: {
    show: false,
  },
};
// Initialize ApexCharts and render
var chart = new ApexCharts(document.querySelector("#show-amount-graph"), options);
chart.render();

I tried to do this, but it did not work.

How to add URL Dependencies dynamically using Parcel?

Problem: I use Parcel as a bundler of my project and try to inject HTML markup into my index.html from my TypeScript file. Injected markup contains <img> elements with dynamically resolved paths for their src attribute. The paths I’m trying to add to the images’ src attributes are stored as properties of my data.json file, which I import directly into my TypeScript file. The problem is that Parcel support only string literals inside new URL() syntax, therefore I don’t know how to use template literals/variables inside this function to add dynamic URL dependencies.

Code:

import data from "../data.json";

const productList: HTMLUListElement | null = document.querySelector(
  ".product-list__list",
);

if (productList) {
  for (const product of data) {
    const markup = `
        <img
          src="${new URL(product.image.mobile, import.meta.url).toString()}"
          alt="${product.name}"
          class="product__image"
        />
   `;

    productList.insertAdjacentHTML("beforeend", markup);
  }
}

What I’ve tried: I tried using template literals, variables inside new URL() function, but it was in vain, since Parcel doesn’t support anything else than string literals inside of it.

Console log not showing the attribute

I am using below HTML for my code.

  <body>
    <div id="myId" class="oldClass">
      This is the original content of the element with ID "myId".
    </div>
  </body>

I am perform DOM Manipulation using below JavaScript Code:

const myElement = document.getElementById('myId');

myElement.setAttribute('data-example', 'value');
console.log(myElement);
myElement.removeAttribute('data-example');
console.log(myElement);

However, first console.log() statement is not displaying the data-example property.

<div id="myId" class="oldClass">
      This is the original content of the element with ID "myId".
    </div>

How to iterate over two properties in an object based on id in JavaScript?

I’m working with a JavaScript object, and when I do console.log(sessions), it outputs the following structure on console:

{
  101: { "id": 101, "nameEn": "English 1", "nameFr": "French 1" },
  102: { "id": 102, "nameEn": "English 2", "nameFr": "French 2" },
  103: { "id": 103, "nameEn": "English 3", "nameFr": "French 3" }
}

The sessions data type is an object.

I’m trying to write a function that retrieves the nameEn and nameFr values based on a given id. Here’s what I’ve tried:

// Function to fetch nameEn and nameFr based on id
const getNameById = (id) => {
  const session = sessions.find(session => session.id === id);  // Line A
  if (session) {
    return { nameEn: session.nameEn, nameFr: session.nameFr };
  } else {
    return `No session found for id ${id}`;
  }
};

// Example usage
console.log(getNameById(101)); 
console.log(getNameById(102)); 
console.log(getNameById(103)); 

However, at Line A, I’m encountering the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'find')

What am I missing, and how can I fix this to properly retrieve the nameEn and nameFr based on the id?

Able to get text content of response object if the json content fails

Is it possible to get the text value of a response if the json decoding fails?

I have the following code:

try {
   var response = await fetch(url, options);
   var data = await response.json();
   // do stuff
}
catch(error) {
   var text = await response.text(); // TypeError: Failed to execute 'text' on 'Response': body stream already read
}

This sometimes happens if the server is down or the network is offline.

I’m realizing it makes the response.json() function useless because if I have errors I’ll always need to get the text value.

Currently the error is:

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Ignore the error above and please let me know if there is a way to get the text value from the response after I call json().

It seems to me that if the method to convert the response to json using the response.json() method fails it should allow you to get the text value. Does that make sense?

How to fix the Sidebar when extend it display below and not sideways

When I try to display on the bottom, it will always display on the right side even after trying to edit with the CSS

I don’t understand on how to change it to make it dropdown below and not on the rightside of the screen

I’m using a vue component and the data’s are stored inside the script

    <nav class="main-menu">
      <h2 class="menu-title">Main Menu</h2>
      <ul class="menu-list">
        <li v-for="(item, index) in mainMenuItems" :key="index" :class="['menu-item', { active: item.active }]" @click="selectMenuItem(item)">
          <img loading="lazy" :src="item.icon" :alt="`${item.text} icon`" class="menu-icon" />
          <span class="menu-text">{{ item.text }}</span>
          <img v-if="item.expandable" loading="lazy" src="https://cdn.builder.io/api/v1/image/assets/TEMP/5622eaac7f157249290a781c986056d5b8bc189ab0f414896a487c987140e352?placeholderIfAbsent=true&apiKey=072fca6f880e47769db5f7634dd8a8c6" alt="Expand icon" class="expand-icon" />

            <!-- Dropdown for expandable items -->
          <ul v-if="item.active && item.children" class="submenu-list">
            <li v-for="(subItem, subIndex) in item.children" :key="subIndex" class="submenu-item">
              {{ subItem.text }}
            </li>
          </ul>
        </li>
      </ul>
    </nav>

I’m expecting it to be displayed on the bottom of the sidebar of it’s parent and not inside and right of it’s parents

JavaScript Animation Not Firing in Deno Fresh Island

I am practicing Deno Fresh, and currently I am attempting to learn how to add animations to islands. I have written the basic island below, including an animation method.

export default function StartAnimation() {
    function animation(): void {
        const _id = setInterval(frame, 10);
        const target = document.getElementById("target");
        let degree = 1;

        function frame() {
            target!.style.transform = `rotate(${degree}deg)`;
            if (degree === 360) {
                degree = 0;
            } else {
                degree++;
            }
        }
    }

    return (
        <div id="frame">
            <div id="target" onLoad={animation}>Test animation</div>
        </div>
    )
}

When running deno task start, I get no errors, and the div appears without issue, but the animation does not run.

Is there anything wrong with my code, and more generally is there a standard way to add animations to islands within Deno Fresh?

X-Cart encodes full colon to %3A in LINE App link which prevents LINE App to be activated, it needs the original :

I need to create a linkable image/text which activates the LINE App on a particular Account.
This is on an X-Cart Popup.
The program encodes the full colon : to %3A which then doesn’t work to activate the LINE App.
Using any number of Script suggestions will make matters worse by inserting spaces etc within the scipt tags which renders ALL those links inoperable.

I need some script or html to prevent the full colon being encoded into %3A.
The program removes some scripts and html when saving!

♦ Original html:

<div class="class=">
        <a href="line://ti/p/~made-in-thai"></a>
        <a href="https://www.madeinthailand.co.th/images/content//made-in-thai_2.jpg"></a>
    </div>
</div>

♦ html after saving:

<div class="class=">
        <a href="line%3A//ti/p/~made-in-thai"></a>
        <a href="https://www.madeinthailand.co.th/images/content//made-in-thai_2.jpg"></a>
    </div>
</div>

Intersection observer not triggering on page load and route back

I use useIntersectionObserver from VueUse to trigger a fade-in animation when an element enters the viewport. If I navigate to another page (e.g., click on an item in the carousel to view its details) and then go back to previous route with the saved position, the intersection observer doesn’t trigger automatically, and the elements remain hidden unless I scroll the page down and up or refresh it. Also, if I scroll to the carousel, click on the carousel item and navigate to another route, the observer fails to trigger sometimes as well. So it’s not only an issue when returning to a route, but also after scrolling and navigating away.

To hide the elements before the observer activates, I use the invisible class, which includes visibility: hidden and opacity: 0. The issue seems to be that intersection observer doesn’t detect the elements when visibility: hidden is applied, so the fade-in animation never starts when returning to the page.

Observer.vue:

<template>
    <div ref="observerRef">
        <slot :isVisible="isVisible" />
    </div>
</template>

<script setup>
import { useIntersectionObserver } from '@vueuse/core';

const props = defineProps({
    rootMargin: {
        type: String,
        default: '0px',
    },
});

const observerRef = ref(null);
const isVisible = ref(false);

const { stop } = useIntersectionObserver(
    observerRef,
    ([{ isIntersecting }]) => {
        if (isIntersecting) {
            isVisible.value = isIntersecting;
            stop();
        }
    },
    {
        rootMargin: props.rootMargin,
    }
);
</script>

Component where I use intersection observer:

<ItemObserver v-slot="{ isVisible }">
    <div :class="isVisible ? 'fade-in' : 'invisible'">
        <CarouselContent>
            <CarouselItem v-for="item in 8" :key="item">
                <NuxtLink
                    to="/">
                    Link
                </NuxtLink>
            </CarouselItem>
        </CarouselContent>
    </div>
</ItemObserver>

css:

@keyframes fadeIn {
    from {
        visibility: hidden;
        opacity: 0;
    }
    to {
        visibility: visible;
        opacity: 1;
    }
}

.fade-in {
    visibility: hidden;
    opacity: 0;
    animation: fadeIn 0.3s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}
.invisible {
    visibility: hidden;
    opacity: 0;
}

Looking for a possible solution.

How to return an array from a Javascript (Wix Velo) query function

I’m new to Javascript and am having trouble understanding async functions (particularly the query function). I have a working query below but need to return the results of that query as an array.

const allComedians = "Comedians";
let shows = ["Heat 1","Heat 2","Heat 3","Heat 4","Heat 5","Showcase 1","Showcase 2","Showcase 3"];
let showKeys = ["1","2","3","4","5","6","7","8"];
let ActiveComedians = [];

function initialize () {
    for (let x = 0; x < shows.length; x++){
        if (project.title === shows[x]){
            wixData.query(allComedians).contains("showKey", showKeys[x])
                .eq("isActive", true)
                .find()
                .then((results) => {
                    for (let i = 0; i < results.items.length; i++){
                        let add = results.items[i].title.trim();
                        ActiveComedians.push(add);
                    }
             })
             .catch((err) => {
             console.log(err);
             })
             return ActiveComedians;
         }
    }
}

Thanks in advance for any clarity you are able to provide.

The above code runs the desired query and delivers the expected results, but I am unable to access the contents of my array ActiveComedians because it isn’t returned until after all other parts of my script execute.

Unable to Close bootstrap modal after submit

I am submitting a form with several fields (columns) interacting with my database where I’m applying CRUD operations. Everything works as needed, except for an issue with the modal. There is a close button that uses data-dismiss=”modal”, which works fine, and a ‘Save Country’ button of type submit. When I click on ‘Save Country,’ it performs the necessary actions, but the modal doesn’t close automatically. If I add data-dismiss=”modal” to the ‘Save Country’ button, it prevents the form submission. Here’s my modal and the functionality for saving:

                <div class="modal-footer">
                    <button class="btn btn-warning btn-sm" data-dismiss="modal" aria-hidden="true"><i class="fa fa-ban"></i> Close</button>
                    <button class="btn btn-primary btn-sm" type="submit"><i class="fa fa-floppy-o"></i> Save Country</button> 
                </div>
        type: "POST",
        dataType: "json",
        beforeSend: function() {
            $("#countries-working").show(); // Show loading indicator
        },
        success: function(response) {
            if (response.valid) {
                refreshCountries(); // Refresh the DataTable
                $('#delete-confirmation-dialog').modal('hide'); // Hide the confirmation modal
                $("#countries-success").show(); // Show success message
                setTimeout(function() {
                    $("#countries-success").hide();
                }, 5000);
            } else {
                console.error('Delete failed: ' + response.msg);
            }
        },
        error: function(r) {
            console.error('Error during delete: ' + r.statusText);
        },
        complete: function() {
            $("#countries-dialog").modal('hide');
            $("#countries-working").hide(); // Hide loading indicator
        }
    });
});

i need a way to just have the modal close once i click on save country (while preserving the functionality of it).

Cors issue when calling one sub domain to another sub domain

I’m getting the following cors error when making a fetch call from one sub domain to another sub domain on the same server.

Access to fetch at 'https://prod.example.com/' from origin 'https://dev.example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The prod Server has the following code:

// allow localhost to talk to remote server
const cors = require("cors");
app.use(cors());

app.use(function(request: Request, response: Response, next: Function) {
  response.header("Access-Control-Allow-Origin", "*");
  next();
});

As you can see I specifically have that header added.

I’ve tried with and without the cors class:

app.use(cors());

I’ve read multiple posts and even followed this guide and I’m at a loss. It’s been multiple days now. I haven’t seen the sun. I don’t know what time it is. There’s about 20 ramen cups scattered across the floor. My cat has climbed into the air conditioning. My bath room mirror has CORS was here smeared across it in siracha sauce. I don’t remember writing it.

Guide
https://stackabuse.com/handling-cors-with-node-js/

How to send a JSON file containing a HTML created image

I am working with my first react based application and am attempting to send an image to my Flask based server but it is saying that the image is not being attached. The basis is to take a live image and then send it to an AI model in order to process the image and I have found success with uploading a file straight, but not with live videos.

This is the main file I am having issues with

`"use client";
import "./myscript.css"
import { useEffect, useRef } from 'react';

const MyWebcam = () => {
    const videoRef = useRef(null);


  useEffect(() => {
    const getUserMedia = async () => {
      try {
        const stream = await navigator.mediaDevices.getUserMedia({ video: true });
        if (videoRef.current) {
          videoRef.current.srcObject = stream;
          videoRef.current.addEventListener('loadedmetadata', () => {})
        }
      } catch (error) {
        console.error(error);
      }
    };

    getUserMedia();

  }, []);

  const takePicture = async () => {
    if (!videoRef.current || !videoRef.current.videoWidth || !videoRef.current.videoHeight) {
        console.log(videoRef.current)
        console.error('Video not ready');
    }
    else{
      const canvas = document.createElement('canvas');
      canvas.width = videoRef.current.videoWidth;
      canvas.height = videoRef.current.videoHeight;
      const context = canvas.getContext('2d');
      context.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height);
      const imgUrl = canvas.toDataURL('image/png');
      const img= document.getElementById("picture")
      img.src = imgUrl

      let data = context.getImageData(0, 0, canvas.width, canvas.height)
      const formData = new FormData()
      formData.append('file', data.data)
      console.log("pre JSON fetching")
      console.log(formData)
  try {
    const response = await fetch("http://localhost:8080/results", {
      method: 'POST',
      body: formData
    });
    console.log(response)
    const data = await response.json();
    console.log('Response:', data);
    let ex =  document.getElementById("translation")
    ex.textContent = data.message
      }
  catch(error){
      console.error(error)        }



    }
    
  }

  return (
<div className="fullscreen-container">
  <div className="input-div">
    <h2>Video Capture</h2>
    <div className="video-container">
      <video ref={videoRef} autoPlay width="900" height="900" />
      <div className="image-container">
        <img id="picture" width="900" height="900" alt="Captured" />
      </div>
    </div>
    <button type="button" onClick={takePicture}>Take Picture</button>
    <p id="translation">Translation</p>
  </div>
</div>



  );
};

export default MyWebcam;
`

This is the server I am trying to send to

from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
from model import ASLModel
import torch
from pathlib import Path
from torchvision import transforms, datasets
from PIL import Image


'Access-Control-Allow-Origin: *'


#app instance
app = Flask('__name__')
CORS(app, resources={r"/*": {"origins": "*"}})
app.config['CORS_HEADERS'] = 'Content-Type'



@app.route("/results", methods=["POST", "GET"])
@cross_origin()
def results():
    if 'file' not in request.files:
        print(request.files)
        return jsonify({'error': 'no file found'})
    print(request.files)
    img = request.files['file']

    trainData = datasets.ImageFolder(root="archive/asl_alphabet_train")
    classNames=trainData.classes
    device = "cpu"
    MODEL_PATH = Path("models")
    MODEL_PATH.mkdir(parents=True, exist_ok=True)
    MODEL_NAME = "ASL_CNN_MODEL.pth"
    MODEL_SAVE_PATH = MODEL_PATH / MODEL_NAME


    LoadedModel = ASLModel(input_shape=3, hidden_units=30, output_shapes=29)
    LoadedModel.load_state_dict(torch.load(MODEL_SAVE_PATH), False)
    LoadedModel.to(device=device)
    transform=transforms.Compose([transforms.Resize(size=(500, 500)), transforms.ToTensor()])
    LoadedModel.eval()

    img = Image.open(img)
    img.show()
    img = transform(img)    
    
    sample = torch.unsqueeze(img, dim=0).to(device)

    predLogit = LoadedModel(sample)

    result = torch.softmax(predLogit.squeeze(), dim=0)
    result = result.argmax()
    
    print("result", classNames[int(result)])
    
    response = jsonify({'message': classNames[int(result)]})
    return response



if __name__ == "__main__":
    app.run(debug=True, port=8080)#port 5000 has issues with requests

And this is the file for the page that lets you upload an image

'use client'
import './upload.css'

const MyInput = () => {
    var img
    const ImageUploaded = () => {
            let input = document.getElementById("file") //Get image
                img = input.files[0]
                let final= document.getElementById("picture") //access displayed tag for image
                final.src = URL.createObjectURL(img)
            
    }


    const SendToModel = async () => {
        // fetch("http://localhost:8080/results").then(
        //     response => response.json()).then(
        //         data => {
                    
        //             let ex =  document.getElementById("translation")
        //             ex.textContent = data.message
        //         }
        //     )


            const formData = new FormData()
            formData.append('file', img)
            console.log("pre JSON fetching")
            console.log(formData)
        try {
        const response = await fetch("http://localhost:8080/results", {
            method: 'POST',
            body: formData
        });
        console.log(response)
        const data = await response.json();
        console.log('Response:', data);
        let ex =  document.getElementById("translation")
        ex.textContent = data.message
            }
        catch(error){
            console.error(error)        }
    }


return (        


<div className="fullscreen-container">
<div className="input-div">
    <h2>Upload Images</h2>
    <p>Drag and drop images here or <span className="browse">browse</span></p>
    <input type="file" id="file" onChange={ImageUploaded} />
    <img id="picture" alt="Uploaded" />
    <button id="submit" onClick={SendToModel}>Submit</button>
    <p id="translation">Translation</p>
</div>
</div>
)}
export default MyInput

Any and all help would be appreciated because the “if file not in request.files” statement only gets hit when I try to send the live image

Use one textarea to update multiple variables

I have a webpage containing a form where for each question, the user enters a numerical response and some additional comments. The comments are currently inputted in an input type=”text”, but to allow for more space, I want to open a dialog with a larger textarea when the input box is clicked.

I would like to create one dialog popup box containing the textarea, which is bound using ngModel to a variable depending on which comment input box is clicked. A JS implementation would also work though.

This is what I have so far:

form-page.component.html

  <br><br>
                        <p-card class="p-fluid">
                            <ng-template pTemplate="title">
                                <span style="color:#00a499;">Maximum Demand (MVA)</span>
                            </ng-template>
                            <ng-template pTemplate="content">
                                <div class="formgrid grid">
                                    <div class="field col">
                                        <label for="remarks_max_demand">Remarks</label>
                                        <input #remarks_max_demand="ngModel" type="text" pInputText
                                            id="remarks_max_demand"
                                            [(ngModel)]="currentRemark"
                                            (click)="openRemarksDialog();setRemark(data.generalData.max_demand.remarks_max_demand)" />
                                    </div>
                                </div>
                            </ng-template>
                        </p-card>

                        <br><br>
                        <p-card class="p-fluid">
                            <ng-template pTemplate="title">
                                <span style="color:#00a499;">Total Installed Capacity (MVA)</span>
                            </ng-template>
                            <ng-template pTemplate="content">
                                <div class="formgrid grid">
                                    <div class="col-12">
                                        <h4 style="text-align: left;">Grid</h4>
                                    </div>
                                    <div class="field col">
                                        <label for="remarks_TIC_grid">Remarks</label>
                                        <input type="text" pInputText id="remarks_TIC_grid" [(ngModel)]="data.generalData.total_installed_capacity.remarks_TIC_grid"
                                        (click)="openRemarksDialog();setRemark(data.generalData.total_installed_capacity.remarks_TIC_grid)"/>
                                    </div>
                                </div>

<p-dialog 
    [(visible)]="visible" 
    [style]="{ width: '600px' }" 
    header="Remarks" 
    [modal]="true" 
    styleClass="p-fluid">

    <ng-template pTemplate="content">
        <div class="field">
            <label for="remarks_input">Please type any remarks.</label>
            <textarea 
                id="remarks_input"
                rows="10"
                cols="30" 
                pInputTextarea 
                [(ngModel)]="currentRemark"
                >
            </textarea>
        </div>
    </ng-template>

    <ng-template pTemplate="footer">
    <p-button 
        label="Continue" 
        icon="pi pi-arrow-right" 
        [text]="true" 
        (onClick)="hideRemarksDialog()" />
    </ng-template>
</p-dialog>

form-page.component.ts

import { Component, OnInit } from '@angular/core';
import { Router, RouterOutlet } from '@angular/router';
import { FormBuilder, Validators } from '@angular/forms';
import { Subscription } from 'rxjs';
import { MessageService } from 'primeng/api';
import { EvaluationService } from './service/data';
import { Dropdown } from 'src/app/models/dropdown.model';
import { DropdownService } from 'src/app/services/dropdown.service';
import { FilterInput, PagedResultDto } from 'src/app/models/custom.model';
import { DefinitionLibrary } from 'src/app/models/definition-library.model';
import { DefinitionLibraryService } from 'src/app/services/definition-library.service';
import { TableLazyLoadEvent } from 'primeng/table';

@Component({
  selector: 'app-form-page',
  templateUrl: './form-page.component.html',
  styleUrl: './form-page.component.scss'
})
export class FormPageComponent implements OnInit {
  data: any;
  currentRemark!: any

  constructor(public messageService: MessageService, public evaluationService: EvaluationService, private dropdownService: DropdownService, private definitionLibraryService: DefinitionLibraryService, private router: Router) { };

    openRemarksDialog() {
    this.visible = true;

  }

  setRemark(data?: any){
    this.currentRemark = data;
  }

  getRemark(){
    return this.currentRemark;
  }

  hideRemarksDialog() {
    this.visible = false;
  }

    ngOnInit(): void {
    this.getOpuDropdown();
    this.data = this.evaluationService.getEvaluationData()
  }
}

The above works for the first remarks box (remarks_max_demand), but not for the others. How can I get it to work for multiple boxes/variables?

Thank you!