Created
September 16, 2014 08:58
-
-
Save CallumVass/b0203cf4fbad0198a591 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function home(testService) { | |
var vm = this; | |
vm.title = "hello world"; | |
testService.someMethod(); | |
} | |
module.exports = home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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