AngularJS custom tag add callback function eval ()
function helloworld(name){ console.log(hello!!!!!+name)} var name=zhangsan;eval(helloworld(name));
Paste the code to the Google console.
Hello !!!!! Zhangsan
You can use this function to return a row of data selected by the user.
Gettabledata (data) is a user-defined function. I will call this row in the ctive encapsulation label to return the data of a row selected by the user to the data as a json object.
// Double-click a row and output the selected data to $ scope. selectRow = function (id) {if (id = 1) {return; // Title line} var trtdid = # + tableuniqueflag ++ id + (parseInt (tableoutcol) + 1); // obtain idvar trtdval =$ (trtdid ). text (); // value var trtdidarray = new Array (); // id Array // trtdidarray = [# b41, # b42, # b43] var trtdvalarray = new Array (); // content Array // trtdvalarray = [a Wang Wu, male, Beijing] for (var I = 0; I
App. controller
(Function () {var app = angular. module ('smcs. app '); app. controller ('medicareinstitutioninfomaintainctrl ', [' $ scope ',' $ http', 'baseurl', '$ modal', 'modal', function ($ scope, $ http, BaseURL, $ modal, Modal) {// data returned in the background $ scope. jsonresulta = [{testname: a Zhang San, sex: Male, addr: Tianjin, tel: 138}, {testname: a dog, sex: Male, addr: Shanghai, tel: 138 },{ testname: a Wang Wu, sex: Male, addr: Beijing, tel: 138 },{ testname: a zhangwu, sex: Male, addr: Beijing, tel: 138 },{ testname: a Hua Mulan, sex: female, addr: Beijing, tel: 138}]; $ scope. showtablecolsa = [{label: 'name', map: 'testname'}, {label: 'gender ', map: 'sex'}, {label: 'address', map: 'addr '}]; $ scope. gettabledata = function (data) {// data json object, which can take the attributes in it. It is more flexible than returning a value. console. log (sex = + data. sex) ;}}]) ;}) ()