介绍下我自己。
npm install binnng
var binnng = require("binnng");
console.log(binnng.birthday); //1990.01.04
在手机上打印调试信息。
Home Page: http://binnng.github.io/debug.js
License: MIT License
一个是 position:fixed 在iOS上有bug 。最好使用 position:absolute;
然后呢,能不能设置log最大显示条数,因为我发现log太多之后就看不到下方的log了。超出了多少条之后会删掉前面的比较好。
最后呢。能不能提供一个简单的方法开关 debug。 开发调试的时候使用debug很好用。但是当我要上线项目的时候该怎么办呢,总不能一条条的删除 debug.log("xxx") 吧.....
define(['angular', 'domReady!', 'debug'], function(angular, doc, debug){
debug.error('in app');
// check angular(shim) and domReady
var app = angular.module('app1', ["binnng/debug"])
.controller('c1', ['$scope', function($scope){
$scope.name = 'kaven';
//$debug.error('error');
}]);
angular.bootstrap(doc.body, ['app1']);
});
debug.error('in app');
任何情况下都正常输出信息。
angular.module('app1', ["binnng/debug"])
报错,
去除依赖,改成 angular.module('app1', [])
不再报错。
错误信息如下:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.2/$injector/modulerr?p0=app1&p1=Error%3A%20…calhost%3A10000%2Fbower_components%2Fangularjs%2Fangular.min.js%3A19%3A339)
请问页面应该如何引入 debug.js,和 angular.js 引入的先后关系是什么样的?
for (fn in debugMap) {
Debug.prototype[fn] = (function(fn) {
return function() {
var msg;
if(arguments.length==1){
msg=arguments[0];
}else{
msg=[].slice.apply(arguments);
}
this.fn = fn;
this.msg = render(msg);
this.color = debugMap[fn];
return this.print();
};
})(fn);
}
这样就可以使用debug.log(1,2,3,4)
;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.