ng-style Questions

2

Solved

I have 2 objects in my project: a company and an user. I have a form where the user can update his profile. One of the things he can update is the country. Now to show the countries I use a dropdow...
Aciniform asked 17/5, 2016 at 7:21

6

I have done a lot of work with the new Angular2 Framework recently. While testing out some of the features, I ended up with the error: Can't bind to 'ngStyle' since it isn't a known native prope...
Whitney asked 8/4, 2016 at 15:33

6

Solved

I have a div that I want to style based on a condition. If styleOne is true I want a background colour of red. If StyleTwo is true, I want the background colour to be blue. I've got half of it work...
Royall asked 14/3, 2018 at 14:57

5

Tag Button already has cursor css assigned. I want to override cursor css according to is_active values to disable button. is_active may have values 0 or 1. Following is code for js/html please le...
Meaghanmeagher asked 16/9, 2015 at 7:43

5

I am trying to set the hover property states using [ngStyle]. The following only sets the normal state colors. When I mouse over the button, the button does not change to the pressed colors as expe...
Tillie asked 18/2, 2017 at 19:41

5

Solved

I want to change position depends on some events. For example at the begining space from top should be 100px, but after button click should be 0px <mat-list-item class="menu-item disabled " dis...
Cynara asked 16/7, 2019 at 7:31

4

Solved

Is it possible to change style of pseudo elements using [style] or [ngStyle] in angular2? in order to get a blur effect on a div acts like an overlay, and I should set up background-image on pseud...
Diaphoresis asked 8/2, 2016 at 21:55

6

Solved

This should be a simple problem, but I can't seem to find a solution. I have the following markup: <div style="width:20px; height:20px; margin-top:10px; border:solid 1px black; background-colo...
Gobbler asked 26/1, 2014 at 14:15

8

Solved

I'm trying to apply a background image to a div by using the angular ng-style ( I tried a custom directive before with the same behaviour ), but it doesn't seem to be working. <nav class="navi...

4

Solved

When I click on a button, I am adding strings to an array and I need to show these strings in a page. But I need to show the text red only after 5th element (first 5 elements should have the text b...
Chiang asked 8/7, 2018 at 17:45

4

Solved

Right now I have a background image URL hard-coded into CSS. I'd like to dynamically choose a background image using logic in AngularJS. Here is what I currently have: HTML <div class="offer-d...
Mullin asked 12/9, 2016 at 8:56

3

Solved

I'm new to angular and keep getting the following error in the console TypeError: name.replace is not a function. I'm not sure what's exactly causing it, but it seems to be caused by the ng-style s...
Congresswoman asked 21/7, 2015 at 20:58

2

Solved

I have a list of colour names in my application. let colours = { mango: '#e59c09', midnight: '#1476a0' }; I want to extend the ngStyle directive to be able to understand my custom colour name...
Dalliance asked 27/6, 2017 at 15:30

4

Solved

I'm trying to build an animation on some phrases that will be displayed on the site main page, in a random position and with fade and translate effects. I would achieve this using ng-style attribu...
Muffle asked 22/9, 2015 at 16:11

1

Solved

When i use Angular to dynamic change div 's backgroundImage, i find there are two ways to set backgrond-image: first: <div style="background:url({{example_expression}})"></div> the s...
Boothman asked 30/6, 2015 at 18:18

3

Solved

I am tring to conditionally set the colors of data elements in a table based on their value using ng-style. Each row of data is being generated using ng repeat. So i have something like: <tr n...
Parting asked 19/4, 2013 at 19:17

2

Solved

I need to have multiple raw style attributes like : $scope.css = "'width': 'calc(100% - "+$scope.fixedColumnsWidth+"'),'margin-left':'"+ $scope.fixedColumnsWidth+"'"; <div ng-style="{css}">...
Canonicals asked 3/4, 2015 at 16:20

2

Solved

I've created a simple directive in Angular which generates a scroller to display some products. I'm having an issue with one part of the code. <ul ng-style="{'margin-left':{{currentMargin}}+'...
Edacity asked 21/11, 2014 at 10:12

1

I need for apply multi css rule to html tag in angular form template. <div class="form-control" id="data.objectStyle" ng-model="data.type" ng-style="getStyle(data.objectStyle)"> {{data.o...
Churchyard asked 11/3, 2014 at 10:12

1

Solved

I've got the following markup: <li ng-repeat="month in months"> <!-- NOTE THAT THIS IS WORKING IN ALL BROWSERS --> <div class="cm-month-grid" ng-style="{width:{{month.pos.width}}...
Raneeraney asked 3/2, 2014 at 14:36

2

I am trying to set the div width dynamically using ng-style but it is not applying the style. Here is the code: <div style="width: 100%;" id="container_fform" ng-controller="custController">...
Disconsolate asked 29/11, 2013 at 13:46
1

© 2022 - 2025 — McMap. All rights reserved.