JavaScript Angular reload Template + Controller without using Routes angular reload template,angular 6 reload template,angular directive reload

I want to reload a template and the connected Controller without using $routeProvider, because my Path-structure doesn't fit with .when(...). I want to use $location.path() to read the URL and set the desired action.

But: if the path of the URL changes, the template doesn't automatically update and neither is the controller reloaded.

Is there a way to say something like this?

angular.module('myApp').controller('ctrl').reload()
Answer:1

I would suggest looking into the Angular UI Router written by the same guys who wrote angular. It will let you transition to different states which is what it sounds like you are trying to do.

https://github.com/angular-ui/ui-router

Answer:2

Currently having a problem in a app. My app is designed to open an RFID reader on a Raspberry PI. It proceeds to read the incoming RFID tags. The code is as follows; // Socket.io server details var ...

Currently having a problem in a app. My app is designed to open an RFID reader on a Raspberry PI. It proceeds to read the incoming RFID tags. The code is as follows; // Socket.io server details var ...

I am calling the Javascript window.open() function to load another url in a pop up window. When the users closes the popup window, I want the MyThanks() function to be called. How I can do this? My ...

I am calling the Javascript window.open() function to load another url in a pop up window. When the users closes the popup window, I want the MyThanks() function to be called. How I can do this? My ...

  1. call function when state changes react
  2. call function when input value changes
  3. call function when enter key is pressed
  4. call function when modal is closed
  5. call function when variable changes angular
  6. call function when element is visible
  7. call function when redux state changes
  8. call function when radio button selected
  9. call function when button is clicked javascript
  10. call function when checkbox is checked in javascript
  11. call function when props change react
  12. call function when checkbox is checked in jquery
  13. call function when page loads javascript
  14. call function when document is ready
  15. call function when submit form
  16. call function when div loads
  17. call function when page loads jquery
  18. call function when props change vue
  19. call function when dom is ready
  20. call function when observable changes

Let's say I have an HTML page, served up from example.com. It makes an javascript ajax request to targetServer.com Which server needs to return a Access-Control-Allow-Origin="(something)"? Is it the ...

Let's say I have an HTML page, served up from example.com. It makes an javascript ajax request to targetServer.com Which server needs to return a Access-Control-Allow-Origin="(something)"? Is it the ...

  1. server that needs staff
  2. who needs server
  3. server that needs help

Hi I have this URL (top) I'm trying to use with "pinterest" they change the url (bottom). Does anybody know how I can change my (top) url to be the same as the "pinterest" url. Is there a Jquery ...

Hi I have this URL (top) I'm trying to use with "pinterest" they change the url (bottom). Does anybody know how I can change my (top) url to be the same as the "pinterest" url. Is there a Jquery ...