Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
</head>
<style>
.active{
color:red;
}
</style>
//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]'){
<!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">
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
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')
'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)
@whisher
whisher / gist:11321581
Created April 26, 2014 14:29
header.html mark-up
<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">
development.js e test.js
module.exports = {
ports: 8443
// ....
};
prodution.js
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
}
})
.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) {