mirror of
https://github.com/BoostIo/Boostnote
synced 2026-04-08 02:05:19 +00:00
rebuild app structure
This commit is contained in:
27
src/services/Modal.js
Normal file
27
src/services/Modal.js
Normal 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
|
||||
}
|
||||
})
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user