Starting to build out the Angular.js app

This commit is contained in:
Will Marshall
2013-12-05 16:31:22 +11:00
parent 3cda12b8dd
commit 102cb62b60
4 changed files with 17 additions and 0 deletions

View File

@@ -5,7 +5,10 @@
#= require ../shared/angular
#= require ../shared/angular-resource
#= require foundation
#= require ./shop
#= require_tree .
$ ->
$(document).foundation()

View File

@@ -0,0 +1,5 @@
angular.module("Shop").controller "ProductsCtrl", ($scope, Product) ->
$scope.products = Product.all()
#console.log Product

View File

@@ -0,0 +1,8 @@
Shop.factory 'Product', ($resource) ->
#return $resource("/shop/products")
class Product
@all: ->
$resource("/shop/products").query()
#new Product

View File

@@ -0,0 +1 @@
window.Shop = angular.module("Shop", ["ngResource"])