It's available in the directive's isolated scope. The id is needed to attach to the like button. The problem is I'm not sure a directive is right for this job and it now seems to be like this should be a service or something.