[AngularJS] Accessing Services from Console
Using the Chrome console, you can access your AngularJS injectable services. This is down and dirty debugging, and can be a lifesaver in troubling times.
You can get services/factories in console by using:
var $injector = angular.element($0).injector();
This $injector can help to skip the form validations on client side, but you do need to check the value on server side.

If you have factory like:
.factory('Projects', function($firebase, fbURL) {
return $firebase(new Firebase(fbURL)).$asArray();
})
You can access it by using:
var Projects = $injector.get("Projects");
Because it uses firebase, therefore, now you can use any firsebase methods, for example:
Projects.$add({name:"", site:"", description: "<<<<<<<<>>>>>>"})
Here site need to be a URL, but if access it from console, we still can add value into the it:


[AngularJS] Accessing Services from Console的更多相关文章
- [AngularJS] Accessing Scope from The Console
Using Angular, you can actually access the scope and other things from the console, so when you have ...
- AngularJS 之Services讲解
Angular带来了很多类型的services.每个都会它自己不同的使用场景.我们将在本节来阐述. 首先我们必须记在心里的是所有的services都是singleton(单例)的,这也是我们所希望得到 ...
- [AngularJS] Using Services in Angular Directives
Directives have dependencies too, and you can use dependency injection to provide services for your ...
- [AngularJS] Accessing The View-Model Inside The link() When Using controllerAs
If u using controller & controllerAs in directive, then the link()'s 4th param 'controller' will ...
- [AngularJS] Accessing Data in HTML -- controllerAs, using promises
<!DOCTYPE html> <html> <head> <title>Access Data From HTML</title> < ...
- [转]调试AngularJS应用
原文链接:Debugging AngularJS Apps from the Console 当我们开发AngularJS应用的时候,我们想在Chrome/FF/IE控制台调试隐藏在应用中的数据和服务 ...
- .NET CORE——Console中使用依赖注入
我们都知道,在 ASP.NET CORE 中通过依赖注入的方式来使用服务十分的简单,而在 Console 中,其实也只是稍微绕了个小弯子而已.不管是内置 DI 组件或者第三方的 DI 组件(如Auto ...
- Decoration2:引入Angularjs显示前台一条数据
SpringMVC内置的RestFul API格式采用的是最复杂最全面的HATEOAS规范,对于简单应用来说,前台解析起来不方便,我们下面主要想办法重新定义一种简单的RestFulAPI. (1)先是 ...
- 【MVC5】First AngularJS
※本文参照<ASP.NET MVC 5高级编程(第5版)> 1.创建Web工程 1-1.选择ASP.NET Web Application→Web API 工程名为[atTheMovie] ...
随机推荐
- 【Unity入门】编辑器常用视图介绍
版权声明:本文为博主原创文章,转载请注明出处. 打开Unity编辑器的主窗口,在窗口的右上角可以看到有个“Layout”按钮.这是用来对Unity编辑器主窗口上面的各个窗口面板进行布局的.通常情况下我 ...
- Ubuntu上安装zsh
先安装zsh,同时移除之前可能的oh-my-zsh的安装 sudo apt-get install zsh if [ -d ~/.oh-my-zsh ]; then rm -r ~/.oh-my-zs ...
- RHAS Linux下架构Lotus Domino详解(附视频)
此处下载操作视频:RHAS Linux下架构Lotus Domino 6.5视频教程 在rhas下架构Lotus Domino 汉化 650) this.width=650;" o ...
- 谈FTP服务器攻击技术及其展望 (下)
上篇回顾:谈FTP服务器攻击技术及其展望 (上)http://chenguang.blog.51cto.com/350944/436876 本文出自 "李晨光原创技术博 ...
- IE8-模拟script onerror
利用VBScript 检测,有副作用,慎用! var loadScript = function () { var DOC = document, HEAD = document.getElement ...
- Labview二进制文件的操作
- enumerate
enumerate 函数用于遍历序列中的元素并分配一个序号(序号默认从零开始 可以制定任意值): >>> for i,j in enumerate(('a','b','c')): p ...
- [置顶] 2013 Multi-University Training Contest 8
1003 Mine 简单sg的博弈题,我们走入了nim博弈的误区,后来发现改了三四个字符就过了....我只能说我是sbsbsbsbsbsb...判奇偶啊... #pragma comment(link ...
- C:函数指针、回调函数
函数指针 是一个指针,指向函数的指针,指针存放的都是地址,所以函数指针存放的是函数的地址.数组名就是数组的首地址,函数名就是函数的首地址.与数组类似. 代码demo int (*p) (int ,in ...
- 《高性能MySQL》
<高性能MySQL>(第3版)讲解MySQL如何工作,为什么如此工作? MySQL系统架构.设计应用技巧.SQL语句优化.服务器性能调优.系统配置管理和安全设置.监控分析,以及复制.扩展和 ...