Notable to link javascript object and angularjs in controllers -


i trying develop mobile application in getting json object using javascript page main.js,now trying print object using angualjs controllers,but not find way.can me out on this?

function written in main.js`

function getviewcolumnssuccess(result){   var httpstatuscode = result.status;     if (200 == httpstatuscode) {       var invocationresult = result.invocationresult;   var issuccessful = invocationresult.issuccessful;    if (true == issuccessful) {    var result = invocationresult.text; //var finalcol=reult;        } else {     alert("error. httpstatuscode=" + httpstatuscode); } } } 

the var result want in democontroller in page

app.controller('tablectrlnew', function($scope,$http) { }); 

first controllers not print data, should databinding, in views.

for example: in controller have var;

$scope.name="john doe";

so, print in view, shoud print in view has scope, print in 1 view(html) simple like:

<span class="labelname"> {{name}}</span> 

it data-binding, automatically print data controller view, remember, must in same scope works.

regards.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -