These are chat archives for angular/angular.js

24th
May 2018
Melvin
@iammelvin
May 24 05:56
Hi
How to use multiple themes in a single web app (Landing page html + Dashboard )
Melvin
@iammelvin
May 24 06:15
Since i have multiple css files for two themes they collide with each other so what is the correct way of adding css and js files ?
a.nvlkv
@anvlkv
May 24 09:35
Hi Guys, is there something like @ContentChild in angular.js?
nerkartushar8
@nerkartushar8
May 24 18:47

Hi guys,
I need to accept html input (template) from user. I need to then compile it using angular's $interpolate function.
So when I get the html from user, I do this.

let $interpolate = this.$injector.get('$interpolate');
let $sanitize = this.$injector.get('$sanitize');
let html = $sanitize(toReturnStyles.cellTemplate);
 el = $interpolate(html)(params);

Then I checked adding <img onload="alert(0)"> </img>, I am good, alert didn't work.
But then I put following and I lost the land under my feet. I saw alerts

    {{constructor.constructor('alert(1)')()}}

Please help me implement this usecase correctly.
Thank you

blake schwartz
@bschwartz757
May 24 20:45
Hello, I've got a really weird issue. I'm upgrading from Angular 1.3 -1.7 and from Jasmine 2.5 - 3. In a test that was working previously, I've got some code that dispatches a MouseEvent('click'), which triggers a directive that toggles an input between type=text and type=password. With the upgraded libs, I can see that the checkbox is getting checked and the event is getting dispatched, but the really weird part is that Angular seems to think the state of the checkbox is 'pristine' even though it's set an attribute modified="true" on the checkbox....
Here's the checkbox before the click event: <input type="checkbox" name="togglePasswordDisplay" ng-model="vm.displayPassword" ng-change="vm.showPasswordClick()" class="ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false"> and after the event: <input type="checkbox" name="togglePasswordDisplay" ng-model="vm.displayPassword" ng-change="vm.showPasswordClick()" class="ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false" modified="true">
yet, if I check the form's state with $scope.formName.$pristine/$invalid/$error both before and after the event it says that the form is pristine in both cases, and also that it is invalid