Modify title with angularJS through a form

0

I have the following code:

         <!-- define-pageTitle -->
    <div id="shareContent">
        <p class="subtitle-app mt30">Define title page</p>
        <form onsubmit="return false">
            <label>Who can browse this hotel:</label>
            <br>
            <input type="text" id="inputPageTitle" placeholder="Define here the title of the page" class="ng-valid ng-dirty">
        </form>
        <br>
        <input class="btnSubmit" type="submit" value="Save" ng-click="saveTitlePage()" hyatt-focus-invalid-field>
        <hr class="silverLinemt30">

    </div>

I need to get the value of the title of this submit and change that of my DOM (title) through angularJS.

The idea is for a user to change the value of the title when he / she understands it through a form where he / she personalizes.

    
asked by anonymous 07.11.2014 / 17:48

1 answer

2

Use ng-model

<title>{{title}}</title>

<!-- define-pageTitle -->
    <div id="shareContent">
        <p class="subtitle-app mt30">{{title}}</p>
        <form onsubmit="return false">
            <label>Who can browse this hotel:</label>
            <br>
            <input type="text" ng-model="title" id="inputPageTitle" placeholder="Define here the title of the page" class="ng-valid ng-dirty">
        </form>
        <br>
        <input class="btnSubmit" type="submit" value="Save" ng-click="saveTitlePage()" hyatt-focus-invalid-field>
        <hr class="silverLinemt30">

    </div>
    
07.11.2014 / 18:06