{"comment":{"url":"https://api.github.com/repos/Ruto8/pwr-workshop-7/comments/9545581","html_url":"https://github.com/Ruto8/pwr-workshop-7/commit/133dcbb78206e43f5cf30cab084ce851614f4f33#commitcomment-9545581","id":9545581,"user":{"login":"hodak","id":3764926,"avatar_url":"https://avatars.githubusercontent.com/u/3764926?v=3","gravatar_id":"","url":"https://api.github.com/users/hodak","html_url":"https://github.com/hodak","followers_url":"https://api.github.com/users/hodak/followers","following_url":"https://api.github.com/users/hodak/following{/other_user}","gists_url":"https://api.github.com/users/hodak/gists{/gist_id}","starred_url":"https://api.github.com/users/hodak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hodak/subscriptions","organizations_url":"https://api.github.com/users/hodak/orgs","repos_url":"https://api.github.com/users/hodak/repos","events_url":"https://api.github.com/users/hodak/events{/privacy}","received_events_url":"https://api.github.com/users/hodak/received_events","type":"User","site_admin":false},"position":4,"line":3,"path":"app/assets/templates/dig.html.slim","commit_id":"133dcbb78206e43f5cf30cab084ce851614f4f33","created_at":"2015-02-02T16:28:03Z","updated_at":"2015-02-02T16:28:03Z","body":"This is okay, but we could do one more thing to make it great ;) This directive makes an assumption that it will always be called in a context, where `dig` is always called `dig` in scope.\r\n\r\nWe could write this directive in a way, so it takes `dig` in an argument, so it can be more reusable, more clear and less magical :wink:\r\n\r\nIt would be called, e.g. `div dg-vote=\"dig\"` and in the directive you could add\r\n\r\n```coffee\r\nscope:\r\n  dig: '=dgVote'\r\n```\r\n\r\nRead more on [isolate scopes](https://umur.io/angularjs-directives-using-isolated-scope-with-attributes/)."}}