Get a multiple object back from req.body - node.js

Is it possible to get req.body back for more than single set of object?
HTML (EJS)
<form action="/newQuote" method="POST">
<h4 id="new-form-heading">New Document</h4>
<div class="total-quote-items">
<div id="item1" class="quote-item">
<div class="form-group">
<label>Item</label>
<a href="#" class="delete-item float-right text-danger" onclick="removeItem(this)"><i
class="fas fa-times-circle"></i></a>
<input type="text" name="name1" class="form-control item-name" placeholder="List your item here !"
required>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label>Quantity</label>
<input type="number" name="quantity1" class="form-control item-quantity" required>
</div>
<div class="form-group col-md-4">
<label>Price</label>
<input type="number" name="price1" class="form-control item-price" required>
</div>
<div class="form-group col-md-4">
<label>Total</label>
<input type="text" name="total1" class="form-control price-total" required>
</div>
</div>
</div>
</div>
<span class="btn btn-info add-item" onclick="addItem()"><i class="fas fa-plus-square"></i> New Item</span>
<div class="modal-footer">
<button class="btn btn-primary d-block" type="submit">Save Changes</button>
</div>
</form>
JS
function addItem() {
numberofDiv = document.querySelectorAll('.quote-item').length + 1
var original = document.querySelector('.quote-item')
var clone = original.cloneNode(true); // "deep" clone
clone.querySelector('.item-name').value = '';
// clone.querySelector('.item-name').name = '';
clone.querySelector('.item-quantity').value = '';
clone.querySelector('.item-quantity').name = '';
clone.querySelector('.item-price').value = '';
clone.querySelector('.item-price').name = '';
clone.querySelector('.price-total').value = '';
clone.querySelector('.price-total').name = '';
original.parentNode.appendChild(clone);
// console.log(numberofDiv)
Array.from(document.querySelectorAll('.quote-item')).forEach((itemId, i) => {
console.log(itemId.querySelector('.item-name').name = 'name' + (i + 1))
console.log(itemId.querySelector('.item-quantity').name = 'quantity' + (i + 1))
console.log(itemId.querySelector('.item-price').name = 'price' + (i + 1))
console.log(itemId.querySelector('.price-total').name = 'total' + (i + 1))
// console.log(i)
itemId.id = 'item' + ( i + 1 )
})
}
function removeItem(param) {
deleteItem = param.parentNode.parentNode
numberofDiv = document.querySelectorAll('.quote-item').length - 1
console.log(numberofDiv)
if (numberofDiv <= 0) {
return
} else {
deleteItem.remove()
}
Array.from(document.querySelectorAll('.quote-item')).forEach((itemId, i) => {
// console.log(itemId)
// console.log(i)
itemId.id = 'item' + ( i + 1 )
})
}
App.js (route)
app.post('/newQuote', (req, res) => {
if (req.isAuthenticated()) {
console.log(req.user.id)
console.log(req.body)
} else {
res.redirect('/login');
}
});
This what I currently got back, as i add more than 1 item
{
name1: 'apple',
quantity1: '123',
price1: '123',
total1: '123',
name2: 'banana',
quantity2: '456',
price2: '456',
total2: '456',
name3: 'carrot',
quantity3: '789',
price3: '789',
total3: '789'
}
This is what how i would want it, (probably?)
{
name1: 'apple',
quantity1: '123',
price1: '123',
total1: '123',
},
{
name2: 'banana',
quantity2: '456',
price2: '456',
total2: '456',
},
{
name3: 'carrot',
quantity3: '789',
price3: '789',
total3: '789',
}
** Should i assign the iterate number for every item's name and other attributes?
** What i'm trying to achieve is req.body and for every input user have added, dynamically save the object(s) to MongoDB (If user add / post 4 quote items = 4 quote documents created and saved), I'm i on the right path here?

Related

Save a specific value from an array of object and store them individually into another state to get the sum ReactJS

In addition to this question
I am trying to map individually a state to another state to store the amountToPay object to get the sum of it. The problem is every time it renders the onChange function. It stores every state as object as you can see here: .
What I want to happen is to only get [434] instead of ['','4','43','434']
So I can .reduce the array to get the sum.
My method on storing the array object to another state is this
const [amountToPay, setAmountToPay] = useState("")
console.log("AMOUNT TO PAY", amountToPay)
useEffect(() => {
serviceItem.map((item) => (
setAmountToPay([...amountToPay, item.amountToPay])
))
}, [serviceItem])
useEffect(() => {
serviceItem.map((item) => (
setAmountToPay([...amountToPay, item.amountToPay])
))
}, [serviceItem])
You can check the whole code here CodeSandbox code.Any help is appreciated :)
There are several things I suggest you to do:
Add some id property to your serviceItem. You can use UUID, nanoid, or even Date.now()
Remove const [amountToPay, setAmountToPay] = useState([]);
Use values directly from serviceItem collection. In order to do this you need to create onChange handler, it will be something like this
const handleChange = (id) => (nextAmount) => {
setServiceList(prevValue => {
return prevValue.map(item => item.id === id ? { ...item, amount: nextAmount } : item)
})
}
And amount to pay can be easily got from serviceItem collection, without effects or other states
const procedurePriceTotal = serviceItem.reduce(
(acc, item) => (acc = acc + item.amount),
0
);
this is happening because you are setting serviceItem on onChange method
and use passed serviceItem as deps array to useeffect in which you are setting amountToPay.
so on every change it's appending in array
Rather then setting amount in useEffect, make a method and call on remove/add button so it will only call after user is finished typing. you can also place a button 'Save' or 'calculate Amount' and call handleSetAmountToPAY method which will update amount.
import React, { useState, useMemo, useEffect } from "react";
export default function App() {
//Values
const [serviceItem, setServiceList] = useState([
{ serviceValue: "", quantityValue: "", amountToPay: "" }
]);
console.log("SERVICE ITEM", serviceItem);
//Add item function
const handleItemAdd = () => {
setServiceList([
...serviceItem,
{ serviceValue: "", quantityValue: "", amountToPay: "" }
]);
handleSetAmountToPAY(serviceItem)
};
//Remove item function
const handleItemRemove = (index) => {
const list = [...serviceItem];
list.splice(index, 1);
setServiceList(list);
handleSetAmountToPAY(list)
};
//Get Values
const handleGetValues = (e, index) => {
const { name, value } = e.target;
const list = [...serviceItem];
list[index][name] = value;
setServiceList(list);
};
//Saving state to another state
const [amountToPay, setAmountToPay] = useState([]);
console.log("AMOUNT TO PAY", amountToPay);
const handleSetAmountToPAY = (list) => {
list && list.map((item) =>
setAmountToPay([...amountToPay, item.amountToPay])
);
}
//Add total amount
const procedurePriceTotal = amountToPay.reduce(
(index, value) => (index = index + value),
0
);
console.log("TOTAL PRICE", procedurePriceTotal);
return (
<div className="App">
{serviceItem.map((singleItem, index) => (
<div class="row form-row">
<div class="col-12 col-md-6 col-lg-4">
<div class="form-group">
<label>
Service <span class="text-danger">*</span>
</label>
<input
name="serviceValue"
type="text"
class="form-control"
value={singleItem.serviceValue}
placeholder="Tooth Extraction"
onChange={(e) => {
handleGetValues(e, index);
}}
/>
</div>
</div>
<div class="col-12 col-md-6 col-lg-3">
<div class="form-group">
<label>
Quantity <span class="text-danger">*</span>
</label>
<input
name="quantityValue"
type="text"
class="form-control"
placeholder="1"
value={singleItem.quantityValue}
onChange={(e) => {
handleGetValues(e, index);
}}
/>
</div>
</div>
<div class="col-12 col-md-6 col-lg-3">
<div class="form-group">
<label>
Amount (₱)<span class="text-danger">*</span>
</label>
<input
name="amountToPay"
type="number"
class="form-control"
placeholder="500"
value={singleItem.amountToPay}
onChange={(e) => {
handleGetValues(e, index);
}}
/>
</div>
</div>
<div class="col-12 col-md-6 col-lg-2">
<div class="add-more">
<br />
{serviceItem.length !== 1 && (
<button
type="submit"
onClick={() => handleItemRemove(index)}
className="btn btn-primary rx-pr"
>
<i className="fas fa-plus" /> Remove Item
</button>
)}
</div>
</div>
</div>
))}
{/* Add Item */}
<div className="add-more-item rx-pr">
<button
type="submit"
onClick={handleItemAdd}
className="btn btn-primary rx-pr"
>
<i className="fas fa-plus" /> Add Item
</button>
</div>
</div>
);
}
I was doing it the wrong way.
I solved it by mapping the serviceItem then using reduce to get the sum instead of putting it again into a separate array of object then mapping it again to get the sum.
const newNumberArray = serviceItem.map(function(item) {
return parseInt(item.amountToPay)
})
const totalAmountPaid = newNumberArray.reduce((index,value) => index = index + value, 0 )
Thanks for all the help and suggestion!

The data is seen after sending in the form, what can it be?

The data is seen after sending in the form, which may be I am using angular as frontend and nodejs as backend, I would greatly appreciate the support please, it should be noted that I am a beginner in angular
<div class="container p-5">
<div class="row">
<div class="col-md-4 mx-auto">
<div class="card">
<div class="card-header">
Acceso al Sistema
</div>
<div class="card-body">
<form (submit)="login()" >
<div class="form-group">
<input type="text" [(ngModel)]="user.email" name="email" class="form-control" placeholder="Email" autofocus>
</div>
<div class="form-group">
<input type="password" [(ngModel)]="user.contrasenia" name="password" class="form-control" placeholder="Contraseña" >
</div>
<button type="submit" class="btn btn-primary btn-block">
Ingresar
</button>
</form>
</div>
</div>
</div>
</div>
</div>
export class Usuarios {
constructor(email=''){
this.email = email
}
_id:string;
nombre_completo: string;
apellido_paterno:string;
apellido_materno:string;
roles:string;
email:string;
contrasenia:string;
}
You can Encrypt the data and send to server and in the server side you can decrypt the data Please find the sample code below
import * as CryptoJS from 'crypto-js';
decryptParams(result, password) {
// console.log('to decrypt' + result);
let decryptedString: any;
const words = CryptoJS.enc.Base64.parse(result);
// console.log('to decrypt' + words);
const textString = CryptoJS.enc.Utf8.stringify(words);
decryptedString = CryptoJS.AES.decrypt(textString, password);
decryptedString = this.hex2a(decryptedString);
return JSON.parse(decryptedString);
}
encryptParams(params, password) {
let encryptedParams: any;
encryptedParams = CryptoJS.AES.encrypt(JSON.stringify(params), password);
encryptedParams = CryptoJS.enc.Utf8.parse(encryptedParams);
encryptedParams = CryptoJS.enc.Base64.stringify(encryptedParams);
// console.log('encry' + encryptedParams);
return encryptedParams;
}
hex2a(hexx) {
const hex = hexx.toString(); // force conversion
let str = '';
for (let i = 0; i < hex.length; i += 2) {
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return str;
}

showing first is real value but second shows undefined in my modal project

my modal code
<form action="/update" method="post">
<div class="modal fade" id="duzen" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Moda1">Etiketi Düzenle</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<input type="text" name="okuyucu" class="form-control okuyucu" placeholder="okuyucu" required>
</div>
<div class="form-group">
<input type="text" name="x" class="form-control x" placeholder="x" required>
</div>
<div class="form-group">
<input type="text" name="y" class="form-control y" placeholder="y" required>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="idnew_table" class="idnew_table">
<button type="button" class="btn btn-secondary btn-pill" data-dismiss="modal">Kapat</button>
<button type="submit" class="btn btn-primary btn-pill">Güncelle</button>
</div>
</div>
</div>
</div>
</form>
my ajax code
<script>
$(document).ready(() => {
var x1="";
var y1="";
var okuyucu1="";
var id="";
$.ajax({
url: "http://localhost:10001/etiketokuyucu",
method: 'GET',
success: function(response){
if(response.length > 0){
for(let index = 0; index < response.length; index++) {
var newRow = $("<tr>");
var cols = "";
var okuyucu = '';
var x = '';
var y = '';
var id='';
cols += '<td>' + response[index].idnew_table+'</td>';
cols += '<td> '+ response[index].okuyucu +'</td>' ;
cols += '<td> '+ response[index].x +'</td>';
cols += '<td> '+ response[index].y +'</td>';
cols += '<td>'
+
'<div class="dropdown d-inline-block widget-dropdown">'+
'<a class="dropdown-toggle icon-burger-mini" href="" role="button" id="dropdown-recent-order1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-display="static"></a>'+
'<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-recent-order1">'+
'<li class="dropdown-item edit">'+
'Düzenle'+
'</li>'+
'<li class="dropdown-item delete">'+
'Sil'+
'</li>'+
'</ul>'+
'</div>'+
'</td>' ;
newRow.append(cols);
$("#example .tbody").append(newRow);
}
}
}
})
})
my modal script code
<script>
$(document).ready(function(){
//showing data to modal for edit record
$('#example').on('click','.edit',function(){
var idnew_table = $(this).data('idnew_table');
var okuyucu= $(this).data('okuyucu');
var x = $(this).data('x');
var y = $(this).data('y');
console.log(idnew_table+"okuyucu="+okuyucu + "x=" +x+" y="+y);
var modal = $(this);
modal.find('#okuyucu').text(okuyucu);
modal.find('#x').text(x);
modal.find('#y').text(y);
/*$('#duzen').modal('show');
$('.okuyucu').val($(this).data('okuyucu'))
$('.x').val(x);
$('.y').val(y);
$('.idnew_table').val(idnew_table);
*/ });
//showing modal for delete record
});
I want to show my mysql data on modal but ı got an error.In this code first show true value in console okuyucu,x,y etc but in modal shows they are undefined.why are they not show true value in my console when they second run?It passes data from ajax to table and I read that value from script code but doesn't show in my modal
Thank you for your help
Your current code for appending value to table was having 2 class edit i.e : li and <a> so when you click on edit link both class where getting called and it was returning undefined .Also , your input inside modal doesn't have any id instead it only have namei have corrected your code .
Demo Code :
//demo data
var response = [{
"idnew_table": "1",
"okuyucu": "abc",
"x": "12",
"y": "fbg"
}, {
"idnew_table": "2",
"okuyucu": "abcd",
"x": "152",
"y": "f5bg"
}, {
"idnew_table": "3",
"okuyucu": "abce",
"x": "125",
"y": "fb5g"
}]
if (response.length > 0) {
for (let index = 0; index < response.length; index++) {
var newRow = $("<tr>");
var cols = "";
var okuyucu = '';
var x = '';
var y = '';
var id = '';
cols += '<td>' + response[index].idnew_table + '</td>';
cols += '<td> ' + response[index].okuyucu + '</td>';
cols += '<td> ' + response[index].x + '</td>';
cols += '<td> ' + response[index].y + '</td>';
cols += '<td>' +
'<div class="dropdown d-inline-block widget-dropdown">' +
'<a class="dropdown-toggle icon-burger-mini" href="" role="button" id="dropdown-recent-order1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-display="static"></a>' +
'<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-recent-order1">' +
'<li class="dropdown-item ">' + //<--remove class edit
'Düzenle'+
'</li>' +
'<li class="dropdown-item delete">' +
'Sil' +
'</li>' +
'</ul>' +
'</div>' +
'</td>';
newRow.append(cols);
$("#example .tbody").append(newRow);
}
}
//showing data to modal for edit record
$('#example').on('click','.edit',function(){
var idnew_table = $(this).data('idnew_table');
var okuyucu = $(this).data('okuyucu');
var x = $(this).data('x');
var y = $(this).data('y');
console.log(idnew_table + "okuyucu=" + okuyucu + "x=" + x + " y=" + y);
//find input under modal and set value of inputs
$("#duzen").find('input[name=okuyucu]').val(okuyucu);
$("#duzen").find('input[name=x]').val(x);
$("#duzen").find('input[name=y]').val(y);
$('#duzen').modal('show');
});
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<table id="example" border="1">
<thead>
<th>idnew_table</th>
<th>okuyucu</th>
<th>x</th>
<th>y</th>
<th>Action</th>
</thead>
<tbody class="tbody">
</tbody>
</table>
<form action="/update" method="post">
<div class="modal fade" id="duzen" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="Moda1">Etiketi Düzenle</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<input type="text" name="okuyucu" class="form-control okuyucu" placeholder="okuyucu" required>
</div>
<div class="form-group">
<input type="text" name="x" class="form-control x" placeholder="x" required>
</div>
<div class="form-group">
<input type="text" name="y" class="form-control y" placeholder="y" required>
</div>
</div>
<div class="modal-footer">
<input type="hidden" name="idnew_table" class="idnew_table">
<button type="button" class="btn btn-secondary btn-pill" data-dismiss="modal">Kapat</button>
<button type="submit" class="btn btn-primary btn-pill">Güncelle</button>
</div>
</div>
</div>
</div>
</form>

Angular 6 - Dynamic Search with HttpParams + Pagination

This is not a question. I am sharing the knowledge I gained after much research and testing. I built a search for optional fields using angle 6 and HttpParams. I am sharing this, because I searched a lot, not having been successful in the search.
Dev. Env.: Angular 6.0.9, Spring boot 2.0.7.
Form:
<form [formGroup]="searchForm" (ngSubmit)="submitSearch()">
<div class="row">
<div class="col-md-1">
<label>Código/Ano: </label>
</div>
<div class="col-md-2">
<input type="text" class="form-control form-control-sm" id="inputCodigo" formControlName="codigo" placeholder="código" maxlength="10">
</div>
<div class="col-md-1">
<input type="text" class="form-control form-control-sm" id="inputAno" formControlName="ano" placeholder="ano" maxlength="4">
</div>
<div class="col-md-1">
<label>Período: </label>
</div>
<div class="col-md-2">
<input type="text" class="form-control form-control-sm" placeholder="de" onfocus="(this.type = 'date')" formControlName="dataInicio">
</div>
<div class="col-md-2">
<input type="text" class="form-control form-control-sm" placeholder="ate" onfocus="(this.type = 'date')" formControlName="dataFinal">
</div>
<div class="col-md-1">
<input class="btn btn-primary btn-sm" type="submit" value="Buscar">
</div>
<div class="col-md-2">
<a [routerLink]="['/documentos/cadastro']" class="btn btn-sm btn-danger">Novo Documento</a>
</div>
</div>
Component:
export class DocumentosComponent implements OnInit {
documentos: Documento[];
searchForm: FormGroup;
docFiltro: DocumentoSearch = new DocumentoSearch();
constructor(
private documentoService: DocumentoService,
private fb: FormBuilder,
private page: Page
) {}
ngOnInit() {
this.page.page = "0";
this.createFormGroup();
this.getDocumentosByFilter();
}
getDocumentosByFilter() {
this.docFiltro = this.searchForm.value;
let searchParams = this.createSearchParam(this.docFiltro);
this.documentoService.findPage(searchParams).subscribe(
data => {
this.documentos = data["content"];
this.page.pages = new Array(data["totalPages"]);
},
error => {
console.log(error.error.message);
}
);
}
createSearchParam(docFiltro: DocumentoSearch): HttpParams {
let searchParams = new HttpParams()
searchParams = searchParams.set("page",this.page.page)
if (
docFiltro.codigo != null &&
docFiltro.codigo != undefined &&
docFiltro.codigo != ""
) {
searchParams = searchParams.set("codigo", docFiltro.codigo);
}
if (
docFiltro.ano != null &&
docFiltro.ano != undefined &&
docFiltro.ano != ""
) {
searchParams = searchParams.set("ano", docFiltro.ano);
}
if (
docFiltro.dataInicio != null &&
docFiltro.dataInicio != undefined &&
docFiltro.dataInicio != ""
) {
searchParams = searchParams.set("dataInicio", docFiltro.dataInicio);
}
if (
docFiltro.dataFinal != null &&
docFiltro.dataFinal != undefined &&
docFiltro.dataFinal != ""
) {
searchParams = searchParams.set("dataFinal", docFiltro.dataFinal);
}
return searchParams;
}
setPage(i, event: any) {
event.preventDefault();
this.page.page = i;
this.getDocumentosByFilter();
}
createFormGroup() {
this.searchForm = this.fb.group({
codigo: [""],
ano: [""],
dataInicio: [""],
dataFinal: [""]
});
}
submitSearch() {
this.page.page = '0';
this.getDocumentosByFilter();
}
}
Service method:
findPage(searchParams: HttpParams) {
return this.http.get<Documento[]>(`${API_URL}/sge/documento/search`, {params: searchParams});
}

Knockout bind string combine integer, why undefined?

My viewModel this..
function ViewModel() {
var self = this;
self.model = {};
self.Message = ko.observable("");
self.model.CurrentDisplayAmr = ko.observable();
self.model.SelectedAmr = ko.observable();
self.model.CurrentAmrWirings = ko.observableArray([]);
self.model.CurrentSelectedWire = ko.observable();
self.model.AmrCommands = ko.observableArray([]);
//selected Amr is update here
self.selectAmr = function (item) {
self.model.SelectedAmr(item);
self.GetAmrWirings();
};
//Amrs search is here
self.GetAmrs = function (searchTerm) {
var self = this; // Retain scope of view model
$.ajax({
url: '/AmrSearch/SearchAmrs',
cache: false,
contentType: 'application/json',
data: ko.toJSON({ AmrNo: self.SearchAmrNo }),
type: "POST",
success: function (result) {
$('#processing-modal').modal('hide');
if (result.success) {
self.model.CurrentDisplayAmr(result.data);
self.Message(result.message);
}
else
self.Message("Modem aramada sorun oluştu: " + result.message);
},
error: function (errorDetail) {
$('#processing-modal').modal('hide');
self.Message("Modem arama isteğinde hata: " + errorDetail);
}
});
}
Amr Selection html is here :
<form class="form-horizontal">
<fieldset>
<div class="col-md-4">
<div class="input-group">
<input disabled type="text" class="form-control" placeholder="0000000" data-bind="value: model.CurrentDisplayAmr.AmrRemoteId">
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-bind="click: $root.selectAmr" data-toggle="modal" data-target="#processing-modal">
<span class="glyphicon glyphicon-ok"></span> Seç
</button>
</span>
</div>
</div>
</fieldset>
</form>
and if i bind text self.model.SelectedAmr.AmrRemoteId is no problem.
this code is ok :
<span class="glyphicon glyphicon-hdd" style="font-size: 38px;"></span> <a data-bind="text:model.SelectedAmr.AmrRemoteId"></a>
result is :
00000012
but if i change this :
<span class="glyphicon glyphicon-hdd" style="font-size: 38px;"></span> <a data-bind="text:'Selected Modem ' + model.SelectedAmr.AmrRemoteId"></a>
result is
Selected Modem undefined
why cant combine string and numeric value?

Resources