News Articles angular

select option independent in formArray Angular

Good evening, I have a problem I am using a reactive form, with FormArray, I have a button to add 2 options as many times as necessary, the problem is that the options are matselects and in one of these selects I use an event (change), the problem is that adding the options for the […]

Javascript Spread Operator Alternative

So I’m working with an old codebase that uses javascript es5, this means I cannot use the spread operator var listOfItems = [ [‘item1’, ‘test’, ‘1’], [‘item2’, ‘test2’, ‘2’] ]; var docDefinition = { style: ‘piecesTable’, table: { widths: [‘*’, ‘*’, ‘*’], body: [ [ {text: ‘Reference’, style: ‘tableHeader’}, {text: ‘Alias’, style: ‘tableHeader’}, {text: ‘Type’, […]

Serve Multiple SPA Apps from .Net Core (Angular & VueJs Vite)

I’m trying to serve up two separate SPA’s (Angular and Vue.js/Vite) from (.Net Core), and unable to correctly route the proxy urls to the hosted apps and assets. Example when launching .net Core and going to the url ‘http://localhost:{port}/vueApp’ i get 404 not found when looking for the assets pointing at http://localhost:{port}/main.ts. What is the […]

How do I change the mode of all modals to ios in Ionic (Angular)?

how can I change the mode of all my modal components in my Ionic 5 application to be shown as ios modals? For one specific modal you can simply write: …. mode: ‘ios’, …. But how/where can you change the default mode for all modals globally to ios? Thank you! Source: JavaSript – Stack Overflow

How can I easily display an array of codes from MongoDB in Angular?

I’m trying to build a simple application that allows users to submit codes to a database and simply display those codes back to them. My database model looks like this, where the text is the actual code to be displayed. For some reason I cannot get the codes to display on the webpage and it’s […]

Collapsible Sidebar using Angular and Bootstrap 4 (load sidebar from: left to right / right to left after a button is pressed)

I am using Angular and Bootstrap 4. I want to create a "collapsible" sidebar, but it should start from left to right when is open and right to left when is closed the sidebar. Example here – Bootstrap I did find the following(angular with bootstrap): Example here – Angular/Bootstrap 4, but it’s not from left […]

HTML align last column right

I have a problem. For my current project I have a page with a list. The list contains posts, which is shown in a css grid. The last 2 columns of the grid need to be text-aligned to the right, but that isn’t working. Here is the code snippet: mat-form-field { margin: 0px 10px; } […]

How to improve rendering performance with *ngFor in Angular

I am creating a chat app, and performance is slow when a lot of messages are sent at once. The messages show up but the UI becomes unresponsive for a while. Here is a simplified version of the code and how can I fix this? HTML: <div class="message-notification" *ngFor="let newMessage of chatMessages"; trackBy: trackByMsgs> <custom-notification […]

Check role claims and show elements if true

I am writting an app with angular on front + on backend. I have 2 roles: user and admin. There are a few buttons on my navbar that I want to hide from user role. My function for checking if currently logged user role is admin: public isUserAdmin = (): boolean => { var […]

Is any standard way to role based access file in angular?

I have developed 4 roles access projects in angular. I have used ngSwitch and show the role-based pages. Anyone knows a different way instead of using ngSwitch. Kindly share your answer. It’s working but I want different solution I have explained what i did, defined 4 role SuperAdmin, Admin, AdminUser, User I have created 4 […]

how can I use one key value from api in another function?

this._batchitem.getCreateBatch(newBatch) .subscribe(data => { this.tvalidStatusCode = ”; this.tAddStatusCode = data.statusCode; if (data.success) {; console.log(data,"this is data for link======") $(‘#successModal’).modal(‘show’); this.color = ‘green’; I want to use encodelink in other function call Source: CSS – Stack Overflow

How to connect Laravel to Angular with out API? [closed]

I am working on a website project in laravel and the front end with angular , I want to link them together but without using API for other purposes on the site , how to do this , thanks Source: JavaSript – Stack Overflow

Angular Material row grouping [closed] ..can some one explain this , I have to do similar to this but I am not understanding as I am new to angular Source: JavaSript – Stack Overflow

Google analytics: goal event is not getting triggered from my angular web application

I have created a goal in my google analytics dashboard and tried to trigger that event from my component.But it is not getting reflecting in google analytics dashboard goals section. FYI-The application is connected fine with the script in index.js. Only issue with the goal event not getting reflected while login to the application. I […]

Slider to display 3 objects from the backend

I’ve recently started learning Angular and I’m wondering to do a certain thing. My plan is to display 3 products fetched from the backend on the page. The main problem is getting the animation to work. The animation would be based on the slider principle. If I click the "right" button current displayed objects should […]

Select all checkbox value on project Init

I have this checkbox image and I need on project Init to set all values as checked. How we can do this in angular ? <section > <p>Select:</p> <p *ngFor="let data of websites | async"> <mat-checkbox [value]="">{{}}</mat-checkbox> </p> </section> website is a observable in which I get data from server Source: JavaSript – Stack Overflow

Angular dynamically add a fieldset with and input and button

Hello and thanks for taking your time to read through my question: So I am new to angular, started about a week ago with the tour of heroes tutorial. I want to have a form, which has an input field taking numbers (15,30,45), which will be used as minutes. It is supposed to have an […]

angular project from github ->The build command requires to be run in an Angular project, but a project definition could not be found

i downloaded an angular project from github (by using "git clone…") when trying to build it (ng build) it gives me this error: The build command requires to be run in an Angular project, but a project definition could not be found. old repositories? Source: JavaSript – Stack Overflow

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.