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的更多相关文章

  1. [AngularJS] Accessing Scope from The Console

    Using Angular, you can actually access the scope and other things from the console, so when you have ...

  2. AngularJS 之Services讲解

    Angular带来了很多类型的services.每个都会它自己不同的使用场景.我们将在本节来阐述. 首先我们必须记在心里的是所有的services都是singleton(单例)的,这也是我们所希望得到 ...

  3. [AngularJS] Using Services in Angular Directives

    Directives have dependencies too, and you can use dependency injection to provide services for your ...

  4. [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 ...

  5. [AngularJS] Accessing Data in HTML -- controllerAs, using promises

    <!DOCTYPE html> <html> <head> <title>Access Data From HTML</title> < ...

  6. [转]调试AngularJS应用

    原文链接:Debugging AngularJS Apps from the Console 当我们开发AngularJS应用的时候,我们想在Chrome/FF/IE控制台调试隐藏在应用中的数据和服务 ...

  7. .NET CORE——Console中使用依赖注入

    我们都知道,在 ASP.NET CORE 中通过依赖注入的方式来使用服务十分的简单,而在 Console 中,其实也只是稍微绕了个小弯子而已.不管是内置 DI 组件或者第三方的 DI 组件(如Auto ...

  8. Decoration2:引入Angularjs显示前台一条数据

    SpringMVC内置的RestFul API格式采用的是最复杂最全面的HATEOAS规范,对于简单应用来说,前台解析起来不方便,我们下面主要想办法重新定义一种简单的RestFulAPI. (1)先是 ...

  9. 【MVC5】First AngularJS

    ※本文参照<ASP.NET MVC 5高级编程(第5版)> 1.创建Web工程 1-1.选择ASP.NET Web Application→Web API 工程名为[atTheMovie] ...

随机推荐

  1. Windows Azure存储容器私有,公共容器,公共Blob的区别

    当我们在Windows Azure中创建或编辑存储的容器时,需要选择访问类型,本文将描述一下这三个选项的区别. 1. 私有: 默认选项,顾名思义,用户不能通过URL匿名进行访问容器或容器内的任何Blo ...

  2. HW7.17

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  3. 数据结构 -- 简单图的实现与遍历 (Java)

    ---恢复内容开始--- 作者版权所有,转载请注明出处,多谢. http://www.cnblogs.com/Henvealf/p/5534071.html 前些天因为某些原因,就试着回想一下图(gr ...

  4. 深入.Net字符串类型

    .Net的字符串其实还是有很多东西可以写的.但是最近在学习SQL Server,只好先做下最近学习到的一些巧用,妙用之类的东西. 巧用String.Join拼接字串数组,字符串集合为字符串.如果在之前 ...

  5. Bezier曲线的原理 及 二次Bezier曲线的实现

    原文地址:http://blog.csdn.net/jimi36/article/details/7792103 Bezier曲线的原理 Bezier曲线是应用于二维图形的曲线.曲线由顶点和控制点组成 ...

  6. [置顶] 2013 Multi-University Training Contest 8

    1003 Mine 简单sg的博弈题,我们走入了nim博弈的误区,后来发现改了三四个字符就过了....我只能说我是sbsbsbsbsbsb...判奇偶啊... #pragma comment(link ...

  7. dbcp 是什么

    Many Apache projects support interaction with a relational database. Creating a new connection for e ...

  8. IP报文解析及基于IP 数据包的洪水攻击

    版本(4bit) 报头长度(4bit) 优先级和服务类型(8bit) 总长度(16bit) 标识(16bit) 标志(3bit) 分段偏移(13bit) 存活期(8bit) 协议(8bit) 报头校验 ...

  9. JedisPoolConfig配置

      JedisPoolConfig config = new JedisPoolConfig();   //连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true config. ...

  10. WPF让人哭笑不得的资源(二)

    再吐槽一下(我已经无力吐槽).今天又被资源搞了一天,发现了一个秘密.大家想听就跟随我... 以前写的一个东东,想用mvvm重新实现一下,由于之前的写得很乱,App.xaml里一坨一坨的,就把资源整到一 ...