I found the solution-  let margin = getComputedStyle(this._el.nativeElement
).getPropertyValue('margin');

On Sunday, March 20, 2016 at 5:09:17 AM UTC+5:30, [email protected] 
wrote:
>
> Here is the component template
>
> template: `<h1 class = "dragStyle" [drag] = "true">DRAG THIS ELEMENT</h1>`,
> styles : [`
>     .dragStyle{
>         margin : 12px;
>     }`]    
>
> Here is the constructor of [drag] attribute directive-
>
> constructor(
>     private _el: ElementRef, 
>     private _renderer : Renderer,
>     @Attribute('class') type : string) {
>         console.log(type);
>
> I need to access the value of margin property associated with the 
> dragStyle class for some computations.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to