![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript(jquery | angualry)
Esengnet
这个作者很懒,什么都没留下…
展开
-
angular $log
function controller($scope,$log){ $scope.setYourName = function(){ $scope.yourname=$scope.fname+" "+$scope.lname; $log.info("info-------------"+$scope.yourname);原创 2014-03-28 10:02:25 · 2098 阅读 · 0 评论 -
js函数调用方式
1. 数组的push调用方式 var ary = [];原创 2014-06-10 10:42:58 · 480 阅读 · 0 评论 -
Angular分页排序
tr, td{ cursor:pointer; text-align: left; padding-top: 2px !important; padding-right: 2px !important; padding-bottom: 2px !important; padding-left: 2px !important;原创 2014-04-04 12:12:50 · 1564 阅读 · 0 评论 -
angular load steps
1. call anonymous function: (function(window, document, undefined) { ... bindJQuery(); publishExternalAPI(angular); jqLite(document).ready(function() { ang原创 2014-03-27 15:56:56 · 1140 阅读 · 0 评论 -
angular select element
1. use obj, the html code like aaa bbb $scope.obj={"a1":"aaa","b1":"bbb","c1","ccc"}; 2. use array, but the optoin's value always array's index,i.e. aaa bbb $scope.objs=[{key:"aaa",value:"a1原创 2014-03-27 18:12:17 · 879 阅读 · 0 评论 -
must re-compile ng element for loading html content dynamically
var $injector = angular.injector(['ng']); var $div = $("#saveProductForm"); $injector.invoke(function($compile) { var scope = angular.element($div).scope(); $compi原创 2014-04-23 13:58:25 · 783 阅读 · 0 评论 -
js function injector
ff.injector('f1',['a','b',function(a,b) { alert(a+":"+b); }]); ff.f1('aa','bb'); ff.injector('f2',['a',function(a){ alert(a); }]); ff.f2("123")原创 2014-04-23 17:44:58 · 540 阅读 · 0 评论 -
angular form validation
1. create a html file like as below body { padding-top:30px; } AngularJS Form Validation原创 2014-03-25 21:56:18 · 1280 阅读 · 0 评论 -
使用JavaScript匿名函数自动调来实现自己的框架
below steps is simple example. setp1 : create a js file named as zms.js //zms.js (function(window) { var zms = window.zms={}; ; var s = function(){alert("s");} var d = function(){alert原创 2014-03-19 17:46:39 · 680 阅读 · 0 评论 -
javascript's call usage
var func1=new function(){ this.name="func1" } var func2=function(x){ var name="func2"; alert(this.name); alert(name); alert(x); } func2.call(fu原创 2014-03-19 18:05:55 · 524 阅读 · 0 评论 -
javascript遍厉对象中的所有属性
var obj={} obj.name = "Jim"; obj.sex = "male"; ob.sayHello = function(name){ return "Hello everybody, i'm " + name; } obj.contact = { tel : "888-88888888", qq : "8888888888原创 2014-03-19 17:56:19 · 564 阅读 · 0 评论 -
jquery syn element value to angularJS'#scope model by change()
1. $("#userName").val("Jim").change(); // $scope.userName will be updated to "Jim" immediately 2. $("body").scope().userName="Jim" // ng-controller is on $("#userDiv").scope().userName="Jim"原创 2014-03-27 14:32:48 · 713 阅读 · 0 评论 -
angular transfer msg from one controller to the other controller by $scope.$on()
ControllerOne BROADCAST ControllerTwo my-component var app = angular.module('app', []); app.factory('sharedService', function($rootScope) {原创 2014-03-27 14:20:47 · 609 阅读 · 0 评论 -
jquery usage
attribute: $(”p”).addClass(css中定义的样式类型); 给某个元素添加样式 $(”img”).attr({src:”test.jpg”,alt:”test Image”}); 给某个元素添加属性/值,参数是map $(”img”).attr(”src”,”test.jpg”); 给某个元素添加属性/值 $(”img”).attr(”title”, function原创 2015-03-23 14:50:46 · 458 阅读 · 0 评论