Answer the question
In order to leave comments, you need to log in
How to use links in text as internal routing in AngularJS?
There is a mobile application on Ionic, which essentially uses just Angular. Receives the news text from the server via json api. The news body can contain links to other news, for example /articles/id... .
How to use them?
I enabled html5mode like this:
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
Answer the question
In order to leave comments, you need to log in
Display the text of the news through the directive where you find all the links and replace them in such a way that they open through ui-sref. Or, passing through the interceptor, replace the links. I would use the second option.
I don't see any other way.
**************************************************
Text of the article:
We replace with:
And we rejoice)))
But how to get the parameters in the router - this is your homework))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question