zoukankan      html  css  js  c++  java
  • 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算了

  • 相关阅读:
    Python解释器相关知识
    简单了解下Flask
    Scoket编程
    __file__的作用
    jquery编写可折叠列表
    浑浑噩噩的一天
    js实现杨辉三角
    js闭包
    python读取word表格
    HTMLTestRunner报告
  • 原文地址:https://www.cnblogs.com/wancy86/p/7739795.html
Copyright © 2011-2022 走看看