1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-04-08 02:05:19 +00:00

rebuild app structure

This commit is contained in:
Rokt33r
2015-06-08 03:56:28 +09:00
parent 010ee6a711
commit 67d8183582
61 changed files with 705 additions and 1266 deletions

27
src/services/Modal.js Normal file
View File

@@ -0,0 +1,27 @@
/* global angular */
angular.module('codexen')
.factory('Modal', function ($modal) {
var newSnippet = function () {
return $modal.open({
templateUrl: 'tpls/modals/new-snippet-modal.tpl.html',
controller: 'NewSnippetModalController as vm'
})
}
var editSnippet = function (snippet) {
return $modal.open({
resolve: {
snippet: function () {
return snippet
}
},
templateUrl: 'tpls/modals/edit-snippet-modal.tpl.html',
controller: 'EditSnippetModalController as vm'
})
}
return {
newSnippet: newSnippet,
editSnippet: editSnippet
}
})

View File

@@ -1,4 +1,5 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('Snippet', function ($http, $auth, apiUrl) {
var findByUser = function (user) {
var url = apiUrl + 'snippets/search'

View File

@@ -1,4 +1,5 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('Tag', function ($http, apiUrl) {
var findByName = function (tagName) {
var url = apiUrl + 'tags/search'

View File

@@ -1,6 +1,7 @@
angular.module('codexen.services')
/* global angular */
angular.module('codexen')
.factory('User', function ($http, apiUrl, $rootScope, $state) {
$rootScope.$on('userSignOut', function(){
$rootScope.$on('userSignOut', function () {
$state.go('auth.signin')
})