how should I define an index variable when angular material table is used as ngFor is not used in this table. I did search for it in the documentation but index is not mentioned any where in it. where and how do i define an index variable for the array that I used in this table, so that I can
Tag: angular
How to call JavaScript functions from Typescript in Angular 5?
I’m working on PDF Viewer development in Angular 5. I’m done with writing HTML code for the UI part. Now I’ve JavaScript files that provide functionality for the UI elements. As Angular 5 supports typescript for implementing functionality for UI components, I want to include JavaScript files in Angular Project and call them from my Typescript code. Questions: How and
How to inherit css styles in child component from parent in Angular 5
I have a parent component inside which I have a child component. The parent component have some css classes, where child component extends them. I tried to use :host as looking at documentation, but cant’t seem to get it work properly. child component: parent component: parent component css: The problem if even I put css classes inside the child component,
Angular Http Subscribe not working
Hi In my Angular Component, i have this code in one of my methods In network tab in chrome dev inspector i saw that my get call returning result, but data is undefined. Why? Answer The reason it was not working originally, is because you had this: You are not returning a value. When you use the curly braces, you
Javascript – convert value of object to uppercase
I have an object in my Angular.io or IONIC and use the following code but it’s not working: I need to convert food panda to FOOD PANDA. How can I do that? Answer toUpperCase returns a new String, it doesn’t modify the original
angular material two check boxes, only one can be checked at a time
I am very new to Angular-material so this question might sound a bit silly, but please bear with me. I have two checkboxes as following. Let’s say a user checked the first checkbox (“Apply for a Job”) then later on clicks on “Modify Job” checkbox, I want the application to automatically uncheck the first one. How can I achieve this
How to clear Local Storage from client whenever i publish new code
I have build my application on Angular 4 and I am using local storage to store user session. What I want is whenever I publish my application, user local Storage should get reset so that data before release should not create any problem. How do i do that? Answer using versioning, keep an extra key at client side which will
How to manage datetime in angular
I’m working with Angular(v5). I have some problem with Datetime. I need the current time and I have to save it in a variable. After that I have to subtract an interval of hours (8 hours or an hour) and save the result in a variable and then do it withconsole.log. I need the format to be: YYYY-MM-DD HH:mm:ss I
Angular 2/4 String Comparison with Ignore Case
I’m comparing a number of fields in an Angular 2 template and it works for same case properties but returns false for the same string on different cases. Is there a way to make it case insensitive perhaps through a simple pipe? Answer You should use === with toLowercase()
How to get rid of Function calls are not supported in decorators in Angular aot compiling?
I am testing a Highcharts Angular2x Wrapper. At first, I had no problem using Angular CLI (1.6.1) “ng serve” and profiling performance with Chrome. Then, i tried to use ahead-of-time compiling to see how that affects the performance. So, using: I get the following error: Now, i know that aot generates factory code for modules and somehow “transformes” templates to