Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

  • Im trying to put the name property of an array into an input box . The array is same one used to supply data points to a serial chart. it works fine

    my code:
    <input type="text" ng-model="ch1Name" ng-init="ch1Name={{points[0].name}}" size="10" >

    if i use {{points[0].name}} just by itself in a <div> it does display the name property but i want it in an input box.


  • Inputs in angularJS use ng-model, a directive for handling data to/from inputs. As this is an angular issue I feel you should go and read angularJS tutorials, you'll see how everything works together.
    The Docs: https://docs.angularjs.org/api
    I'll show you how to do this one.

    There are two ways:

    1. Map the variable of the input to be the same as the point.
    <input ng-model="points[0].name"  id="pt1name" type="text" />
    
    1. use ng-init to set the value of the input textbox on load:
    <input type="text" ng-model="point1Name"  ng-init="point1Name=point[0].name" />
    
    

    You don't need {{}} inside the attribute because it's an angularJS directive. Look in the browser console and you'd likely see a bunch of errors.

    Fox


  • Thanks MattFox,

    I had success using #1 in your reply. I hadnt thought of that.

    I cannot get solution #2 to work. I had focused my energy on that way and should have used solution #1


  • Might be because the second way needs the init outside in another element... probably a parent div. I usually use the first way myself, as I write and map everything in my own controllers.
    At least you're learning, that's the main thing!