T
T
Turar Abu2017-05-18 08:38:12
JavaScript
Turar Abu, 2017-05-18 08:38:12

How to run two controllers?

There is a routing on angular 1.2:

route
    .when('/:lang/:page/:id/:attribute', {
      template    : '',
      controller  : lang
  })
  .when('/:lang/guide/:id', {
    templateUrl : '/view/guide.html',
    controller  : guide
  });

The first routing is for working with the language, the second one processes the page. In this case, it is necessary that when:
example.com/ru/guide/1
Two controllers start: langand gudie
But only one controller starts lang. How can I set up routing so that both work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sasha, 2017-05-18
@madmages

can be done. But there is more of a conceptual problem here. How do you imagine it?

O
ozknemoy, 2017-05-18
@ozknemoy

one must first rethink the current architecture. IMHO this is a crutch initially. you can of course make one route and make a component in it, the controller of which will pick up the parameters from the url

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question