mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 18:26:26 +00:00
rebuild app structure
This commit is contained in:
22
src/controllers/states/SnippetsDetailController.js
Normal file
22
src/controllers/states/SnippetsDetailController.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.controller('SnippetsDetailController', function (Snippet, $state, $rootScope) {
|
||||
var vm = this
|
||||
|
||||
vm.isLoaded = false
|
||||
|
||||
var snippetId = $state.params.id
|
||||
|
||||
Snippet.show(snippetId)
|
||||
.success(function (data) {
|
||||
vm.snippet = data.snippet
|
||||
vm.isLoaded = true
|
||||
})
|
||||
|
||||
vm.delete = function () {
|
||||
Snippet.delete(vm.snippet._id)
|
||||
.success(function () {
|
||||
$rootScope.$broadcast('snippetDeleted')
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user