()
| 14181 | } |
| 14182 | |
| 14183 | function update() { |
| 14184 | var locals = $route.current && $route.current.locals, |
| 14185 | template = locals && locals.$template; |
| 14186 | |
| 14187 | if (template) { |
| 14188 | element.html(template); |
| 14189 | destroyLastScope(); |
| 14190 | |
| 14191 | var link = $compile(element.contents()), |
| 14192 | current = $route.current, |
| 14193 | controller; |
| 14194 | |
| 14195 | lastScope = current.scope = scope.$new(); |
| 14196 | if (current.controller) { |
| 14197 | locals.$scope = lastScope; |
| 14198 | controller = $controller(current.controller, locals); |
| 14199 | element.children().data('$ngControllerController', controller); |
| 14200 | } |
| 14201 | |
| 14202 | link(lastScope); |
| 14203 | lastScope.$emit('$viewContentLoaded'); |
| 14204 | lastScope.$eval(onloadExp); |
| 14205 | |
| 14206 | // $anchorScroll might listen on event... |
| 14207 | $anchorScroll(); |
| 14208 | } else { |
| 14209 | clearContent(); |
| 14210 | } |
| 14211 | } |
| 14212 | } |
| 14213 | }; |
| 14214 | }]; |
no test coverage detected