[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] ...
随机推荐
- char型指针与其它指针或数组的细节
一道常见题 char * str7="abc"; char * str8="abc"; cout<<(str7==str8)<<endl ...
- Asp.Net学习进度备忘(第一步:ASP.NET Web Forms)
书签:“Web Pages”和“MVC”跳过:另外跳过的内容有待跟进 __________________ 学习资源:W3School. _________________ 跳过的内容: 1.ASP. ...
- DOM笔记(七):开发JQuery插件
在上一篇笔记本中,讲解了如何利用jQuery扩展全局函数和对象:DOM笔记(六):怎么进行JQuery扩展? 在这篇笔记本中,将开发一个简单的动画插件,名称是example-plugin,用其实现一个 ...
- javascript函数sort
sort函数用于对数组的元素进行排序 语法:arrayObject.sort(sortby); 参数sortby可选,规定排序顺序,必须是函数. 如果调用该方法时没有使用参数,将按照字幕顺序进行排序, ...
- 高效使用STL
高效使用STL 参考:http://blog.jobbole.com/99115/ 仅仅是个选择的问题,都是STL,可能写出来的效率相差几倍:熟悉以下条款,高效的使用STL: 当对象很大时,建立指针 ...
- 装饰模式decorator
C++设计模式——装饰模式 前言 在实际开发时,你有没有碰到过这种问题:开发一个类,封装了一个对象的核心操作,而这些操作就是客户使用该类时都会去调用的操作:而有一些非核心的操作,可能会使用,也可能不会 ...
- 牛课--C/C++
引用是除指针外另一个可以产生多态效果的手段. //引用是除指针外另一个可以产生多态效果的手段. #include<iostream> using namespace std; class ...
- effective c++:private继承
如果class间使用private继承关系,编译器就不会自动的将派生类转换为基类,而且private继承而来的成员都变为private属性. private继承意味着根据某物实现出,当我们想要避免重复 ...
- 解决Socket.IO在IE8下触发disconnect时间过长
本文地址: http://www.cnblogs.com/blackmanba/p/solve-socketIO-IE8-emit-disconnect-too-long.html或者http://f ...
- Application_Error
//出现未捕捉的异常时,系统调用本方法,一般用于记录日志.错误页的重定向一般在web.config中设置. protected void Application_Error(object ...