javascript - how to use angular js in zend framework 2 -


i newbee zend framework 2, , try use angular js in project.

actually @ present, calling function name in controller this.

return new viewmodel(array(                  'result' =>  $result ,                  'userdata' => $row,                  'userinfo' => $userinfo,                )); 

and in view page. looping view.

 <?php if( $this->result )   { ?>         <?php foreach ($this->result $data) {    ?>         <tr>             <td><?php echo $data['patient_fname']; ?></td>             <td><?php echo $data['weight']; ?></td>             <td><?php echo $data['height']; ?></td>             <td><?php echo $data['bp_level_low']; ?>/<?php echo $data['bp_level_high']; ?></td>             <!-- <td><?php echo $data['sugar_level_random']; ?></td> -->             <td>                 <a href="<?php echo $this->url('doctor', array('action'=>'editvitalrecords', 'id' => $data['hrid'] ));?>"> edit </a>                 <!-- |                 <a href="<?php echo $this->url('doctor', array('action'=>'deletevitalrecords', 'id' => $data['hrid'] ));?>">delete </a> -->             </td>         </tr>         <?php } ?>         <?php } ?> 

so how can use angular js in above code.

thanks,

angular js need json response, simplest way change strategy json in module config code

'view_manager' => array(         'strategies' => array(             'viewjsonstrategy',         ),     ), 

after in controller must type

 return new jsonmodel((array(                 'result' =>  $result ,                 'userdata' => $row,                 'userinfo' => $userinfo,             )); 

link nice tutorial http://hantsy.blogspot.com/2013/11/create-restful-application-with_19.html


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -