我有一个演示jsonp数据
var APP = angular.module('JsonApp', []);
APP.controller('TheCtrl', ['$scope','$http', function ($scope, $http) {
$http.jsonp('http://www.filltext.com/?rows=30&id={index}&fname={firstName}&lname={lastName}&sales={number|100}&bonus={number|10}&orderday={date|10-10-2014,10-12-2015}&callback=JSON_CALLBACK')
.success(function(data) {
$scope.users = data;
})
}])
数据只有名字和姓氏,我怎么能得到像这样的全名 fullname = fname + lname
我的模板是
{{user.fullName}}
感谢。
答案 0 :(得分:2)
尝试
{{user.fName + " " + user.lName}}
您也可以简单地写
{{user.fName}} {{user.lName}}