Skip to content

Instantly share code, notes, and snippets.

namespace FbswitBlog\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use FbswitBlog\Service\Category as CategoryService;
class FbswitBlogService extends AbstractPlugin
{
protected $categoryService;
public function getCategoryService()
//app.php
'providers' => array('Cartalyst\Sentry\SentryServiceProvider'),
'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
//I've made like
namespace FbswitBlog\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use FbswitBlog\Service\Category as CategoryService;
use FbswitBlog\Service\ContentNodes as ContentNodesService;
use FbswitBlog\Service\Page as PageService;
class FbswitBlogService extends AbstractPlugin
{
<?php
$recipes = array(
array(
'id'=> 1,
'title'=>'Cookies1',
'description'=>'Delicious1, crisp on the outside, chewy 1',
'ingredients'=> array(
'amount'=> '1',
'amountUnits'=> 'packet',
'ingredientName'=> 'Chips Ahoy'
//services.js
services.factory('RecipeLoader',function(Recipe, $route, $q) {
return function() {
var delay = $q.defer();
Recipe.query({id: $route.current.params.recipeId}, function(recipe) {
delay.resolve(recipe);
}, function() {
delay.reject('Unable to fetch recipe ' + $route.current.params.recipeId);
});
return delay.promise;
services.factory('RecipeLoader',function(Recipe, $q) {
return function() {
var delay = $q.defer();
Recipe.query({id: 1}, function(recipe) {
delay.resolve(recipe);
}, function() {
delay.reject('Unable to fetch recipe ' + 1);
});
return delay.promise;
};
var app = angular.module( 'app', [] );
var MyFunc = function() {
this.name = "default name";
this.$get = function() {
this.name = "new name"
return "Hello from MyFunc.$get(). this.name = " + this.name;
};
/// <reference path="../lib/angular.d.ts"/>
/// <reference path="../lib/angular-resource.d.ts"/>
class MyApp{
public app:AngularModule;
constructor(){
this.app = angular.module('myApp', ['ngResource']);
this.app.config(($routeProvider:ng.RouteProvider) => {
$routeProvider.
when('/', {
templateUrl: './view.html',
<!DOCTYPE html>
<html>
<head>
<title>AngularJS Fb Test</title>
</head>
<body>
<div id="fb-root"></div>
<h1>index.html test get rid of me</h1>
<div data-ng-app="app">
grunt test
Running "clean:server" (clean) task
Cleaning .tmp...OK
Running "concurrent:test" (concurrent) task
Running "copy:styles" (copy) task
Copied 2 files
Done, without errors.