Whenever we want to share data across domains. Additionally, thanks to Angular’s dependency injection system, this is both very easy to do and very clean.
module.service( 'Book', [ '$rootScope', function( $rootScope ) {
var service = {
if (!Date.prototype.toISOString) { | |
Date.prototype.toISOString = function () { | |
function pad(n) { return n < 10 ? '0' + n : n; } | |
function ms(n) { return n < 10 ? '00'+ n : n < 100 ? '0' + n : n } | |
return this.getFullYear() + '-' + | |
pad(this.getMonth() + 1) + '-' + | |
pad(this.getDate()) + 'T' + | |
pad(this.getHours()) + ':' + | |
pad(this.getMinutes()) + ':' + | |
pad(this.getSeconds()) + '.' + |
Whenever we want to share data across domains. Additionally, thanks to Angular’s dependency injection system, this is both very easy to do and very clean.
module.service( 'Book', [ '$rootScope', function( $rootScope ) {
var service = {
package main | |
import ( | |
"fmt" | |
"log" | |
"os/exec" | |
"runtime" | |
) | |
type Worker struct { |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.
What is the role of
.component()
?
template
or templateUrl