I want to display directions with an arrow and was thinking to use the standard ionic arrow for the direction. Can I rotate the up arrow into any direction somehow?
ion-arrow-up-a
Here is an attempt from the comments below
<i class="icon ion-arrow-up-a" rotate degrees="90"></i>
angular.module('app.customDirectives', []).directive('rotate', function() {
return {
link: function(scope, element, attrs) {
// watch the degrees attribute, and update the UI when it changes
scope.$watch(attrs.degrees, function(rotateDegrees) {
// console.log(rotateDegrees);
//transform the css to rotate based on the new rotateDegrees
element.css({
'-moz-transform': 'rotate(' + rotateDegrees + 'deg)',
'-webkit-transform': 'rotate(' + rotateDegrees + 'deg)',
'-o-transform': 'rotate(' + rotateDegrees + 'deg)',
'-ms-transform': 'rotate(' + rotateDegrees + 'deg)'
});
});
}
}
});
css({ '-moz-transform': 'rotate(' + rotateDegrees + 'deg)', '-webkit-transform': 'rotate(' + rotateDegrees + 'deg)', '-o-transform': 'rotate(' + rotateDegrees + 'deg)', '-ms-transform': 'rotate(' + rotateDegrees + 'deg)' }); }); } } }); javascript. ionic-framework. ionicons.
Size. To specify the icon size, you can use the size attribute for our pre-defined font sizes. Or you can set a specific size by applying the font-size CSS property on the ion-icon component. It's recommended to use pixel sizes that are a multiple of 8 (8, 16, 32, 64, etc.)
To embed an Ionicon in HTML all you have to do is copy the scripts from the installation section of the Ionicons and paste them in your HTML document. Afterward, select the Ionicon of your choice, copy the component code and paste it into your HTML document.
You may try disabling ion-icon popup using CSS event blocking and set "title" property on to a parent element. Or you can create Icon element using the below code as a workaround and set it on a button. Save this answer.
Similar to above, this is how I did it...
HTML:
<i class="ion-arrow-up-c rotate-90">
CSS:
.rotate-90 {
display: inline-block;
transform: rotate(90deg);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With