F
F
fryette2014-11-16 22:08:08
JavaScript
fryette, 2014-11-16 22:08:08

Is there a function that is called once?

There is a select with two options that translates the page into one or another language, I wrote a JS code that saves the choice of language, however, angular only works when the selecta changes, is there a function that would immediately call translate()?

<select id="seltag" ng-change="translate()" ng-model="selectedLanguage" onchange="sessionStorage.seltag=this.selectedIndex">
                        <option value="en">English</option>
                        <option value="ru">Russian</option>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Tsivilev, 2014-11-16
@fryette

<body onload="translate('ru');">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question