Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:44:36+00:00 2026-06-15T23:44:36+00:00

This is my markup <div id=username ng-controller=quickUserAdd> <h1>User</h1> <input placeholder=your full name ng-model=fullname> <div

  • 0

This is my markup

    <div id="username" ng-controller="quickUserAdd">
    <h1>User</h1>
    <input placeholder="your full name" ng-model="fullname">
    <div ng-show="fullname">
        <div>
            <span class="big">Username</span>
            <span class="small">{{username()}}</span>
        </div>
        <div class="password-{{passwordStatus()}}">
            <input type="password" ng-model="password" placeholder="Password"/>
            <span class="small">{{passwordStatus()}}</span>
        </div>
    </div>
</div>

And my controller:

    var passwordStrengths = ["weak", "medium", "ok", "great"];
    function quickUserAdd($scope)
    {
        $scope.password = "";
        $scope.fullname = "";
                   ....
    }

How do I bind $scope.fullname, $scope.username and $scope.password to installation.user[0] (where installation is a global object), so that on any change of fullname, username or password, they’re updated in installation.user[0] (also an object)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:44:37+00:00Added an answer on June 15, 2026 at 11:44 pm

    I’m sure that you are well aware of problems with global variables so I assume here that you don’t have other choice and in your use-case you need to access a globally defined JavaScript object.

    Probably the easiest way forward in your case is to expose the installation.user[0] on a scope in your controller like so:

    function quickUserAdd($scope) {
       $scope.user = installation.user[0];
       ....
    }
    

    and then bind to properties of the user object like this:

    <input placeholder="your full name" ng-model="user.fullname">
    <input type="password" ng-model="user.password" placeholder="Password">
    

    This way any changes in an input box should be imediatelly propagated to the global variable.

    Please note that if you would like to change the global variable outside of the AngularJS world and have the UI still updated you will have to wrap this change into the Scope.$apply() method.

    If I could suggest one more thing: usually people tend to name AngularJS controllers starting with an uppercase and add the Ctrl suffix so your controller could be named like QuickUserAddCtrl;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I start with this markup: <div> <span> <label for=Item[0]>Item #1</label> <input type=text value= name=Item
I have this markup <div class=input text> <label for=Experience0ExperienceContent>Experience Content</label> <input name=data[Experience][0][experience_content] class=span3 id=Experience0ExperienceContent
I have this markup: <span class=top_ticker_middle></span> <div class=pc_elements> <fieldset class=checkable> <span class=as_cp_checkbox></span> <input type=hidden
In this markup, I need to replace the label text E-mail with User Name.
With this markup: <div id=e> <div id=f></div> </div> Does $('#e > #f') return the
I have this markup: <div id=slider1> <div class=ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all> <a style=left:
hi i'm having this markup: <div id=main> <div nam=item>1</div> <div nam=item>2</div> <div> <div nam=item>3</div>
After creating a div on the fly with this markup: $('.circuit').prepend(<div class='component' draggable='true'>TRANSISTOR</div>); It
Given this markup: // Calendar.html?date=1/2/2003 <script> $(function() { $('.inlinedatepicker').datepicker(); }); </script> ... <div class=inlinedatepicker
I have this markup in an MVC app. <div id=ingredientlistdiv> <% Recipe recipe =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.