After diving into Angular JS for the first time, I've hit a roadblock at an essential stage. My setup consists of an AngularJS front end and Grails backend. Check out the code snippets below along with my query.
- URL Mapping entry:
as
"/graph"(controller: 'Graph')
- This is my Grails controller/action which renders the GSP:
as
class GraphController {
def index() {
render(view: "../graph", model: [employeeId: "197040"])
}
}
- This is the AngularJS file, saved as graph.gsp:
Upon visiting the URL: hostname:port/graph I can see the message "Hi ! Welcome" displayed. However, I'm struggling to find a simple way to retrieve the employeeId and show it as "Hi ! Welcome 197040" (i.e., accessing the employeeId variable sent from the backend)
<div><h3>Hi ! Welcome {{employeeId}}</h3></div>
did not yield the desired outcome.
I apologize if this seems like a fundamental question, but I have yet to come across a clear solution anywhere.