stingray中使用angularjs

引入angularjs

手动启用angularjs

不使用ng-app, 在所有模块和controller定义后挂载启用angularjs

function OnLoad() {
  scroll(0, 0);

  angular.module('myApp',[]).controller('myAppController',['$scope',function($scope){
    $scope.title='hello angular';
    $scope.student={
      name: 'Mark',
      age: 28,
      Gender: 'Female',
      Phy_State: 'FL',
      Brief: 'Mark is a good lad',
    }
    $scope.saveStudent=function(){
      Communication.CustomRequest('test.max?ajax_action=saveStudent&'+$.param($scope.student),function(resp){
         //
      });
    }

  }]);



 angular.element(function() {
      //angular.bootstrap(window.document.getElementById('rightColumn'), ['myApp']);
      //angular.bootstrap($('#rightColumn'), ['myApp']);
      angular.bootstrap(document.getElementById('rightColumn'), ['myApp']);
 });
}

vuejs

本来想尝试用vuejs的, 怎么引用都和系统的js不兼容, 还是直接angularjs算了

原文地址:https://www.cnblogs.com/wancy86/p/7739795.html