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
<!doctype html> | |
<html ng-app="myApp"> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<style> | |
.active{ | |
color:red; | |
} | |
</style> |
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
//php | |
<?php | |
$data = file_get_contents("php://input"); | |
$data = json_decode($data,true); | |
if(isset($data['email'])){ | |
if(empty($data['email'])){ | |
header("HTTP/1.0 404 Not Found"); | |
exit; | |
} | |
elseif($data['email'] !== '[email protected]'){ |
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
<!DOCTYPE html> | |
<html id="ng-app" xmlns:ng="http://angularjs.org" lang="it" data-ng-app="nodblog"> | |
<head> | |
<meta charset="utf-8"> | |
<title>My App</title> | |
</head> | |
<body data-ng-controller="MainCtrl"> | |
<div id="wrap"> | |
<div class="navbar navbar-fixed-top navbar-inverse"> | |
<div class="container"> |
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
TypeError: /home/app/views/layouts/default.jade:20 18| | <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> 19| script. > 20| var config = #{JSON.encode(config)}; 21| body(data-ng-controller="MainCtrl") 22| div.navbar.navbar-fixed-top.navbar-inverse 23| div.container Object #<Object> has no method 'encode' at eval (eval at <anonymous> (/home/node_modules/jade/lib/jade.js:160:8), <anonymous>:71:61) at res (/home/node_modules/jade/lib/jade.js:161:38) at Object.exports.render (/home/node_modules/jade/lib/jade.js:257:10) at Object.exports.renderFile (/home/node_modules/jade/lib/jade.js:293:18) at View.exports.renderFile [as engine] (/home/node_modules/jade/lib/jade.js:278:21) at View.render (/home/node_modules/express/lib/view.js:76:8) at Function.app.render (/home/node_modules/express/lib/application.js:504:10) at ServerResponse.res.render [as _render] (/home/node_modules/express/lib/response.js:798:7) at ServerResponse.res.render (/home/node_module |
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
doctype html | |
html#ng-app(xmlns:ng='http://angularjs.org', lang='it', data-ng-app='nodblog') | |
head | |
meta(charset='utf-8') | |
meta(name='viewport', content='width=device-width, initial-scale=1, user-scalable=no') | |
meta(name='robots', content='index,follow') | |
meta(name='fragment', content='!') | |
title= appTitle | |
meta(name='title', content='nodBlog') | |
meta(name='description', content='nodBlog') |
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'; | |
//Global service for global variables | |
angular.module('mean.system').factory('Global', [ | |
function() { | |
var _this = this; | |
_this._data = { | |
user: window.user, | |
authenticated: !! window.user, | |
isAdmin: !!window.user && (_.indexOf(window.user.roles, 'admin') !== -1) |
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
<div class="container" data-ng-controller="HeaderController"> | |
<div class="navbar-header"> | |
<button type="button" data-toggle="collapse" data-target="#navbar-collapse" class="navbar-toggle"> | |
<span class="sr-only">Toggle navigation</span> | |
<span class="icon-bar"></span><span class="icon-bar"></span> | |
<span class="icon-bar"> </span></button> | |
<a href="/" class="navbar-brand" mean-token="'site-title'">LaLista</a> | |
</div> | |
<div id="navbar-collapse" class="collapse navbar-collapse"> | |
<ul class="nav navbar-nav navbar-left"> |
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
development.js e test.js | |
module.exports = { | |
ports: 8443 | |
// .... | |
}; | |
prodution.js |
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
angular.module('mean.system') | |
.factory('Menus', ['$http','$q', function($http,$q) { | |
return { | |
get : function(name,defaultMenu){ | |
var deferred = $q.defer(); | |
$http.get('/admin/menu/'+name, { | |
params: { | |
defaultMenu: defaultMenu | |
} | |
}) |
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
.controller('ArticleCreateCtrl', ['$scope', '$state', '$filter', 'Articles', function ($scope, $state, $filter, Articles) { | |
$scope.article = {}; | |
$scope.save = function(){ | |
$scope.article.categories = $filter('strcstoarray')($scope.article.categories); | |
Articles.store($scope.article).then( | |
function(data) { | |
$scope.article = data; | |
return $state.transitionTo('articles'); | |
}, | |
function(err) { |