seperated logic out of index.ejs
create page directives
change page to post item page on click with angular