AngularJS custom tag add callback function eval ()

Source: Internet
Author: User

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) ;}}]) ;}) ()


 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.