mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Starting to build out the Angular.js app
This commit is contained in:
@@ -5,7 +5,10 @@
|
||||
#= require ../shared/angular
|
||||
#= require ../shared/angular-resource
|
||||
#= require foundation
|
||||
#= require ./shop
|
||||
#= require_tree .
|
||||
|
||||
$ ->
|
||||
$(document).foundation()
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
angular.module("Shop").controller "ProductsCtrl", ($scope, Product) ->
|
||||
$scope.products = Product.all()
|
||||
#console.log Product
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Shop.factory 'Product', ($resource) ->
|
||||
#return $resource("/shop/products")
|
||||
class Product
|
||||
@all: ->
|
||||
$resource("/shop/products").query()
|
||||
|
||||
#new Product
|
||||
|
||||
1
app/assets/javascripts/darkswarm/shop.js.coffee
Normal file
1
app/assets/javascripts/darkswarm/shop.js.coffee
Normal file
@@ -0,0 +1 @@
|
||||
window.Shop = angular.module("Shop", ["ngResource"])
|
||||
Reference in New Issue
Block a user