Skip to content

Instantly share code, notes, and snippets.

@cminhho
Last active August 29, 2015 14:22
Show Gist options
  • Save cminhho/8077bd87df47defc3120 to your computer and use it in GitHub Desktop.
Save cminhho/8077bd87df47defc3120 to your computer and use it in GitHub Desktop.
Todo

$anchorScroll

https://docs.angularjs.org/api/ng/service/$anchorScroll

improving-angular-web-app-performance-example.html

http://bahmutov.calepin.co/improving-angular-web-app-performance-example.html http://www.williambrownstreet.net/blog/2014/04/faster-angularjs-rendering-angularjs-and-reactjs/ https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications http://www.alexkras.com/11-tips-to-improve-angularjs-performance/ http://tech.small-improvements.com/2013/09/10/angularjs-performance-with-large-lists/ console.time("TimerName"); setTimeout(function(){ console.timeEnd("TimerName"); }, 100); //In console $: TimerName: 100.324ms

angularjs-in-action/angello

https://github.com/angularjs-in-action/angello/tree/master/client/src/angello/app/services

promises

http://blog.thoughtram.io/angularjs/2014/12/18/exploring-angular-1.3-es6-style-promises.html

#angularjs-data-binding-best-practice http://www.ngroutes.com/questions/AUuADYb-a5vEqxqlK6Qt/angularjs-data-binding-best-practice.html

http://www.ngroutes.com/questions/AUuYZe5jReouG_5xAiF8/injecting-runnable-javascript-dynamically-with-an-angular-directive.html

Writing AngularJS Documentation

https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation

eval('alert($scope.html)')

registerController http://plnkr.co/edit/x3G38bi7iqtXKSDE09pN?p=preview http://jsfiddle.net/MzseV/7/ http://refork.com/x4bc

angular.forEach(config_data,function(key,value) { config_module.constant(value,key); }

New Angular Router: Linking to other components with parameters http://plnkr.co/edit/2C40t4?p=preview

useApplyAsync method Exploring Angular 1.3: Go fast with $applyAsync http://blog.thoughtram.io/angularjs/2015/01/14/exploring-angular-1.3-speed-up-with-applyAsync.html app.config(function ($httpProvider) { $httpProvider.useApplyAsync(true); });

onceDone(function (files) { files.forEach(function (filename, fileIndex) { filename.size(function (err, values) { values.width.forEach(function (value) { // ... and so on }); }); }); });

return deferred.promise; http://plnkr.co/edit/m1B8xQ8HbujAKIAqKIN3?p=preview

scope.$parent.$watch

http://stackoverflow.com/questions/19944036/angular-dynamic-templating-directives?rq=1

http://plnkr.co/edit/YknLpunzJlroE9Qwgrtk?p=preview <!doctype html>

<title>Example - example-example112-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-sanitize.js"></script> <script src="script.js"></script>
{{html}}

Hello {{ clock.now }}!

(function() { var ctrl = function($scope) { var html = '{{trustedHTML}}'; var javascript = '(function () { alert(2) })();';

$scope.html = html;
$scope.javascript = javascript;

}; var directive = function($parse, $sce) { return { restrict: 'E', replace: false, template: '{{trustedHTML}}

' + '
',

    link:function($scope, element, attr) {
        $scope.trustedHTML = $sce.trustAsHtml($scope.html);
        
        var script = angular.element(document.createElement('script'));
        var source = $scope.javascript;
        script[0].text = source;
        angular.element(element).append(script[0]);
    }
};

};

angular.module('mySceApp', []) .directive('bindJavascript', directive) .controller('MAinController', ctrl) })();

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