Skip to content

Instantly share code, notes, and snippets.

@yoren
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoren/572b4fc3fa1e84d9f7fc to your computer and use it in GitHub Desktop.
Save yoren/572b4fc3fa1e84d9f7fc to your computer and use it in GitHub Desktop.
Minification Errors In My AngularJS WordPress Theme
//Main controller
app.controller('Main', ['$scope', '$http', function(a, b) {
b.get('wp-json/posts/').success(function(res){
a.posts = res;
});
}]);
//Main controller
var mainFunc = function($scope, $http) {
$http.get('wp-json/posts/').success(function(res){
$scope.posts = res;
});
};
mainFunc.$inject = ['$scope', '$http'];
app.controller('Main', mainFunc);
//Main controller
app.controller('Main', ['$scope', '$http', function($scope, $http) {
$http.get('wp-json/posts/').success(function(res){
$scope.posts = res;
});
}]);
var app = angular.module('app', ['ngRoute', 'ngSanitize']);
var app=angular.module("app",["ngRoute","ngSanitize"]);app.config(["$routeProvider","$locationProvider",function(t,e){e.html5Mode(!0),t.when("/",{templateUrl:myLocalized.partials+"main.html",controller:"Main"}).when("/demo",{templateUrl:myLocalized.partials+"demo.html",controller:"Main"}).when("/:ID",{templateUrl:myLocalized.partials+"content.html",controller:"Content"})}]),app.controller("Main",["$scope","$http",function(t,e){e.get("wp-json/posts/").success(function(e){t.posts=e})}]),app.controller("Content",["$scope","$http","$routeParams",function(t,e,o){e.get("wp-json/posts/"+o.ID).success(function(e){t.post=e})}]),app.directive("searchForm",function(){return{restrict:"EA",template:'Search Keyword: <input type="text" name="s" ng-model="filter.s" ng-change="search()">',controller:["$scope","$http",function(t,e){t.filter={s:""},t.search=function(){e.get("wp-json/posts/?filter[s]="+t.filter.s).success(function(e){t.posts=e})}}]}});
//# sourceMappingURL=./scripts.min.js.map
["James", "Bond", function(James, Bond){}];
["James","Bond",function(e,t){}]
@yoren
Copy link
Author

yoren commented Jan 7, 2015

For more information, please refer to my post: Minification Errors In My AngularJS WordPress Theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment