javascript - AngularJS - Curly brackets not working consistently -


i'm developing spa using angularjs (and bootstrap) , there several controllers, each specific page , function. since site must support language, labels retrieved db upon language selection, , added $rootscope (i.e. $rootscope.labels). works when used like:

  <h2>{{labels.title}}:</h2> 

now, there page when additional data constructed , added $rootscope presentation, $rootscope.page_a_values.

when running in debug mode (chrome) , both printing console contents of $rootscope.page_a_values, defined string there expected.

within html of page included like:

 <h2>{{labels.this_page_title}}: {{page_a_values.actual_title}}</h2> 

getting:

 title: 

("title" value of "labels.this_page_title")

meaning, "page_a_values.actual_title" replaced nothing (i guess replacement takes place because curly brackets not shown).

needless say, tried {{$rootscope.page_a_values.actual_title}} , didn't work either.

any suggestion highly appreciated. thanks.

stupid me! structure contents page controller json, , forgot "parse" string real json object. works expected.


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -