jeudi 24 novembre 2016

Check checkbox after button click in other state

I have 2 states - register and rules. In register i have checkbox "Agree with terms". In rules state i have button agree. If i click agree in rules, state must change to register and the checkbox in register must be checked.

This is register

<md-checkbox id="rules" class="blue myriad circle" ng-model="check" ng-change="changeAgree()" style="margin-bottom: 0px"></md-checkbox>
    <label id="rule_link" class="gray" style="width: 220px; line-height: 24px">
        Susipažinau ir sutinku su <u class="white" ui-sref="rules">taisyklėmis</u>
    </label>

This is rules

    <md-button class="md-raised blue-dark-button white" ng-click="agree()">Sutinku</md-button>

Controller

$scope.agree = function () {
            $scope.check = true;
            $state.go('register');
        };




Aucun commentaire:

Enregistrer un commentaire