Skip to content

Instantly share code, notes, and snippets.

@CallumVass
Created September 16, 2014 08:58
Show Gist options
  • Save CallumVass/b0203cf4fbad0198a591 to your computer and use it in GitHub Desktop.
Save CallumVass/b0203cf4fbad0198a591 to your computer and use it in GitHub Desktop.
"use strict";
require("angular");
require("angular-route");
var home = require("./controllers/home");
var testService = require("./services/testService");
angular.module("app", ["ngRoute"])
.config(function ($routeProvider) {
$routeProvider.when("/", {
templateUrl: "./templates/home.html"
})
;
})
.controller("home", home)
.factory("testService", testService);
"use strict";
function home(testService) {
var vm = this;
vm.title = "hello world";
testService.someMethod();
}
module.exports = home;
"use strict";
function testService() {
return {
someMethod: function() {
console.log("called someMethod");
}
}
}
module.exports = testService;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment