Friday 15 May 2015

javascript - How do I use expressions outside of ng-repeat scope? -



javascript - How do I use expressions outside of ng-repeat scope? -

i'm making job board built in angularjs , craft cms. users can register, login , create job posting. job postings beingness fetched json file , displayed on index page using ng-repeat. want user able click each job posting , have specific job posting open within modal on same page (to maintain them on same page) problem is.

since modal generated outside of ng-repeat, expressions don't work. here's example.

<div class="jobs"> <div class="job-panel" ng-repeat="job in jobs> <a href=""><h3>{{ '{{job.title}}' }}</h3></a> <p><strong>location: </strong>{{ '{{job.jobcity}}' }}, {{ '{{job.jobstate}}' }} <strong>post date: </strong>{{ '{{job.postdate}}' }}</p> <p><strong>job category: </strong>{{ '{{job.jobcategory}}' }}</p> <p><strong>job overview: </strong>{{ '{{job.joboverview}}' }} <a class="show-details" data-remodal-target="modal">(details)</a></p> <div class="remodal" data-remodal-id="modal" data-remodal-options="hashtracking: false"> <h3>{{job.title}}</h3> <p><strong>location: </strong>{{ '{{job.jobcity}}' }}, {{ '{{job.jobstate}}' }} <strong>post date: </strong>{{ '{{job.postdate}}' }}</p> <p><strong>job category: </strong>{{ '{{job.jobcategory}}' }}</p> <p><strong>job overview: </strong>{{ '{{job.joboverview}}' }}</p> </div> </div> </div>

everything within "job-panel" divs displayed fine, modal div within doesn't grab same expressions when user opens modal can see text without expressions. i'm going assume because jquery plugin uses (remodal) generates html on top level html alongside container , not within job-panel div i've placed it. need way have user click (details) link , view more info json file within modal.

here's images of site looks like. first index view postings listed , sec how modal generated.

image 1 image 2

javascript jquery json angularjs

No comments:

Post a Comment