The facebook scraper doesn’t support javascript, it just reads the html source. While all modern search engines support javascript based sites, social networks like facebook and twitter don’t.
The only way to have dynamic data in the meta tags for facebook is by using server-side rendering. You could use php to generate the content or a service like prerender.io as @psweb mentioned.