Note that there are some explanatory texts on larger screens.

plurals
  1. POSave some search information between two routings
    primarykey
    data
    text
    <p>I have a routing</p> <pre><code>app.config(function ($routeProvider) { $routeProvider. when("/questions", {controller:"Questions", templateUrl: "questions.html"}). when("/objections", {controller: "Objections", templateUrl: "objections.html"}). when("/objections/:oId", {controller: "Objections", templateUrl: "objections.html"}). when("/persons", {controller: "Persons", templateUrl: "persons.html"}). when("/persons/:pId", {controller: "Persons", templateUrl: "persons.html"}). when("/questions/:qId", {controller: "Questions", templateUrl: "questions.html"}). otherwise({redirectTo : "/persons"}); }) </code></pre> <p>and the one template for /objectionsand /objections/:pId</p> <pre><code>&lt;script type="text/ng-template" id="objections.html"&gt; &lt;div class="stroke"&gt; &lt;label&gt;Поиск: &lt;input class="border" type="text" ng-model="search.text"&gt;&lt;/label&gt; &lt;ul class="objections-objections left_column"&gt; &lt;li class="border" ng-repeat="objection in objections | filter:search"&gt; &lt;a href="#/objections/{{objection.id}}"&gt; {{objection.text}} &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div class="right_column"&gt; &lt;p class="header"&gt;&lt;/p&gt; &lt;p class="text"&gt; &lt;span&gt;ID возражения: {{objection.id}}&lt;/span&gt; &lt;br&gt; &lt;textarea class="border" name="" id="" cols="30" rows="10" ng-model="objection.text"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;ul class="questions-objections" ng-show="objection.questions.length"&gt; &lt;span&gt;Список вопросов&lt;/span&gt; &lt;li class="border" ng-repeat="question in objection.questions"&gt; &lt;a href="#/questions/{{question.id}}"&gt;{{question.text}}&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p class="footer"&gt; &lt;button ng-click="add()"&gt;Добавить&lt;/button&gt; &lt;a href="" ng-click="delete(objection)"&gt;Удалить&lt;/a&gt; &lt;a href="" class="save" ng-click="save()"&gt;Сохранить&lt;/a&gt; &lt;a href="" class="close" ng-click="cancel()"&gt;Закрыть&lt;/a&gt; &lt;/p&gt; &lt;/div&gt; </code></pre> <p> </p> <p>so when i input text into search field and have sorted list items then i click to the one of items and see sleared seearch field</p> <p>how should i reqrite my code that search.text directive won't be reset between this routing?</p> <p>thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload