Is it possible to dynamically change global stylesheets in Angular 2?

Is it possible to dynamically change global stylesheets? EDIT: The purpose is to allow the user to pick the styles he prefers. In Angular 1, I was able to wrap a controller around the head tag and use bindings in there. Example below (simplified code): index.html <!DOCTYPE html> <html ng-app=”app” ng-controller=”AppController”> <head> <title>Title</title> <link rel=”stylesheet” … Read more

When not to use ‘track by $index’ in an AngularJS ng-repeat?

I recently got the console error ` Error: [ngRepeat:dupes] duplicates in a repeater are not allowed. Use ‘track by’ expression to specify unique keys… — AngularJS Error Reference – ngRepeat:dupes which I then used ‘track by $index’ and the issue was solved… But that got me thinking… is there a reason why you wouldn’t want … Read more

SheetJS xlsx-cell styling

I am referring this example to export a worksheet https://github.com/SheetJS/js-xlsx/issues/817. How to do cell styling like background coloring,font size and increasing the width of the cells to make the data fit exactly.I have gone through the documentation but couldn’t find any proper examples to use fill etc.Is there a way to do the formatting? Below … Read more

Angular and Grunt

I’m a Grunt newbie and I’m trying to convert an Angular app (based on angular-seed) to use it for CSS/JS concat/minification. I have an index.html file that defines the CSS and JS files: <!– build:css css/myjmh.css –> <link rel=”stylesheet” href=”lib/bootstrap/bootstrap.min.css”/> <link rel=”stylesheet” href=”lib/font-awesome/font-awesome.min.css”/> <link rel=”stylesheet” href=”lib/toaster/toaster.css”/> <link rel=”stylesheet” href=”css/app.css”/> <link rel=”stylesheet” href=”css/custom.css”/> <link rel=”stylesheet” href=”css/responsive.css”/> … Read more

angular NaNunction%2C%20got%20undefined exception

right justified and i want to have a partial view depending on which tab was clicked. found some sample code online to get me started but am unable to figure out the tabs by following a sample code index.html <!doctype html> <html ng-app=”mainApp”> <head> </head> <body> <div ng-view> </div> <script src=”scripts/lib/angular.min.js”></script> <script src=”scripts/lib/angular-route.min.js”></script> <script src=”scripts/lib/bootstrap.min.js”></script> … Read more

Ui-sref and md-button. How it works?

Example Why menu item “Menu1” above the others if i add ui-sref ???? <md-button ui-sref=”menu1″ >Menu1</md-button> <md-button>Menu2</md-button> Answer It’s actually better to wrap the button in the a tag. The problem with the recommended solution is that only the text acts as a link rather than the whole button, so I’d suggest; <a ui-sref=”menu1″><md-button>Menu1</md-button></a> AttributionSource … Read more

AngularJS, promise with recursive function

I’m trying to use the AngularJS promise/then with a recursive function. But the then-function is not called (none of the error-, success-, notify-callbacks gets called). Here is my code: recursive function loadSection2 = function() { var apiURL = “http://…” var deferred = $q.defer(); $http({ method: “GET”, url: apiURL }).success(function(result, status, headers, config) { console.log(result); loadCount++; … Read more