No value accessor for form control with unspecified name attribute in Angular Material Table

I have an Angular Material Table. I want to display it based by a value which can change. If the value is true, should be displayed, otherwise not. When the value is changing to true I get this error: Error: No value accessor for form control with unspecified name attribute. I suppose that I didn’t […]

Angular unit testing a function variable

I want to test a variable function of a void function. How can I get that local variable in the test? function: save(){ const stringTest="test"; } test: test("variable should be equal to "test" ", () => { component.save(); //test stringTest from save function that is equal to "test" }); Source: Angular Questions

By denisiulian
Published
Categorized as angular, testing, typescript, unit-testing Tagged , , ,

Angular Material Table- how to save data?

I have the basic angular material table. Is there any possibility to save the data which is displayed in the table (I mean to save every row of data) when you click a button? If yes, how can I do it? How can I get every row of data? I want to save every row […]

Save all inputs from the user

I have an table with a column for the user input. Obviously, the table can have several rows, every row with an input for the user. Under the table I have a button for saving. My question is: if a user type in several inputs, how can I save all the inputs? Example: my table […]

Typescript interface – add new value dynamically or create the interface dynamically

I have an Angular Material Table. Obviously, I have an interface from which is created the dataSource for the table. Is there any possibility to add a new value dynamically in the interface Or at least to create the interface dynamycally? Because the data which is coming from the backend it’s unknown. Example: from this: […]

Typescript create new map<String, List<String>>

I’m trying to create a new Map in Typescript like this: Map<String, List < String > >. Something like (this example is in java): private map<String, List<String>> map = HashMap<String, ArrayList<String>(); Until now my code is: categoryMap=new Map(); I tried different approaches but it doesn’t work. How it can be done? Source: Angular Questions

By denisiulian
Published
Categorized as angular, hashmap, javascript, typescript Tagged , , ,

Span ellipsis it’s not working on mat-header-cell

I have a table and I’m trying to use span ellipsis on the mat-header-cell. It doesn’t work properly. The ellipsis doesn’t apply on the element. The whole text is displayed in the column. Instead of: "Name… " it’s displaying "Name Name Name Name Name" (just an example). HTML: <div class="mat-elevation-z8 layout-container"> <table mat-table [dataSource]="dataSource"> <ng-container […]

By denisiulian
Published
Categorized as angular, css, ellipsis, flexbox, html Tagged , , , ,

Span ellipsis it’s not working on mat-header-cell

I have an table and I’m trying to use span ellipsis on the mat-header-cell. It is not working. It just displays: "example example example example". How can I resolve it? <ng-container matColumnDef="example"> <th mat-header-cell *matHeaderCellDef [attr.rowspan]="2"><span class="ellipsis">example example example example</span></th> <td mat-cell *matCellDef="let element">example</td> </ng-container> CSS: span.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } […]

By denisiulian
Published
Categorized as angular, css, ellipsis, html Tagged , , ,

Angular create new component with specific name

I’m trying to generate a new component with a name like: myApplication.html/css/ts. I’m using this command: ng generate component myApplication. The problem is that the resulted component has this name: my-application.html/css/ts. It’s not myApplication as I want. Is there any solution for this problem? Source: AngularJS Questions

Checkboxes aligned on row

I have multiple checkboxes and everyone is displayed on a row. I want to have 3 or 4 checkboxes on a row, but I can’t do it. Angular: <div class="form"> <mat-label>Choose skills:</mat-label> <div class="container"> <div *ngFor="let skill of listOfSkills; index as i" id="skills"> <input type="checkbox" (change)="getSkill($event,i)">{{skill}} </div> </div> </div> CSS: .container input[type=checkbox]{ display:inline-block; width: 200px; […]

By denisiulian
Published
Categorized as angular, css, html, typescript Tagged , , ,

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq