diff --git a/package.json b/package.json index 71189f7..e781093 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "babel-preset-stage-2": "6.24.1", "gh-pages": "1.2.0", "node-sass": "4.9.2", - "parcel-bundler": "1.9.7", + "parcel-bundler": "1.9.8", "rimraf": "2.6.2" } } diff --git a/src/js/app.js b/src/js/app.js index 1371ede..ded65a2 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,5 +1,3 @@ -const fs = require('fs'); - //defines the AngularJS app as a module angular .module('westerosiApp', [ @@ -18,36 +16,36 @@ angular $stateProvider .state('about', { url: '/about', - template: fs.readFileSync('./src/partials/about.html', 'utf8') + template: require('../partials/about.html') }) .state('houses', { url: '/houses', - template: fs.readFileSync('./src/partials/houseList.html', 'utf8'), + template: require('../partials/houseList.html'), controller: 'HouseListCtrl' }) .state('newHouse', { url: '/newHouse', - template: fs.readFileSync('./src/partials/house.html', 'utf8'), + template: require('../partials/house.html'), controller: 'NewHouseCtrl' }) .state('houses.item', { url: '/:item', - template: fs.readFileSync('./src/partials/house.html', 'utf8'), + template: require('../partials/house.html'), controller: 'OneHouseCtrl' }) .state('characters', { url: '/characters', - template: fs.readFileSync('./src/partials/characterList.html', 'utf8'), + template: require('../partials/characterList.html'), controller: 'CharacterListCtrl' }) .state('newCharacter', { url: '/newCharacter', - template: fs.readFileSync('./src/partials/character.html', 'utf8'), + template: require('../partials/character.html'), controller: 'NewCharacterCtrl' }) .state('characters.item', { url: '/:item', - template: fs.readFileSync('./src/partials/character.html', 'utf8'), + template: require('../partials/character.html'), controller: 'OneCharacterCtrl' }); } diff --git a/src/js/directives.js b/src/js/directives.js index 53c24f5..721bde9 100644 --- a/src/js/directives.js +++ b/src/js/directives.js @@ -1,5 +1,3 @@ -const fs = require('fs'); - //defines the AngularJS app as a module angular .module('westerosiApp') @@ -12,7 +10,7 @@ angular .directive('navBar', function() { return { restrict: 'E', - template: fs.readFileSync('./src/partials/nav.html', 'utf8'), + template: require('../partials/nav.html'), controller: ["$scope", "$location", function($scope, $location) { $scope.isActive = function(route) { return route === $location.path();