These are chat archives for angular/material

11th
Jan 2018
jan
@janmegert
Jan 11 2018 07:51

hey
new to angular, maybe there's some quick help
tried to work with angular material, following these instructions
comiling works but with a ton of warnings like this:

WARNING in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.sass (Emitted value instead of an instance of Error) postcss-custom-properties: D:\siscontrol\src\styles.sass:9569:3: Custom property ignored: not scoped to the top-level :root element (.mdc-button--theme-dark .mdc-button--secondary.mdc-ripple-upgraded,.mdc-theme--dark .mdc-button--secondary.mdc-ripple-upgraded { ... --mdc-ripple-fg-opacity: ... }) NonErrorEmittedError: (Emitted value instead of an instance of Error) postcss-custom-properties: D:\siscontrol\src\styles.sass:9569:3: Custom property ignored: not scoped to the top-level :root element (.mdc-button--theme-dark .mdc-button--secondary.mdc-ripple-upgraded,.mdc-theme--dark .mdc-button--secondary.mdc-ripple-upgraded { ... --mdc-ripple-fg-opacity: ... }) at Object.emitWarning (D:\siscontrol\node_modules\webpack\lib\NormalModule.js:117:16) at result.warnings.forEach (D:\siscontrol\node_modules\postcss-loader\lib\index.js:149:49) at Array.forEach (<anonymous>) at postcss.process.then (D:\siscontrol\node_modules\postcss-loader\lib\index.js:149:27) at <anonymous> @ ./src/styles.sass 4:14-191 @ multi ./src/styles.sass

@import '~@angular-mdc/theme'; in the .sass seems to cause the issue

any idea? would be apreciated, thanks!

Shirish Akhare
@lucifer7894
Jan 11 2018 10:17
services in node as post and get are working on localhost fine but as i put them on server it show 404 error
Jeff
@Jefftopia
Jan 11 2018 16:33
I think there's a bug with Tabs + Accordion. The second tab default expands every accordion item.
Anyone able to weigh in on this?
texirv0203
@texirv0203
Jan 11 2018 21:28

hi,

  • In the sample angular app I included intercom.
  • but I am getting an error ---> Uncaught ReferenceError: Intercom is not defined
  • can you tell me how to fix it.
  • providing my code snippet below.
  • even I updated with the APP_ID still same problem.
  • any idea how to fix it

Intercom : https://docs.intercom.com/install-on-your-product-or-site/quick-install/install-intercom-on-your-web-app-for-logged-in-users
sample angular app: https://github.com/derrekyoung/appd-sampleapp-angular2

  <script>
        //let attributes=this.nbcuService.getSeesionStorageValue();
        //console.log("attributes--->" + attributes);
        Intercom('trackEvent', 'share-link');

        window.intercomSettings = {
            app_id: 'APP_ID',
            name: "Jane Doe", // Full name
            email: "customer@example.com", // Email address
            created_at: 1312182000 // Signup date as a Unix timestamp
        };
    </script>

    <script>
        (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/APP_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
    </script>
texirv0203
@texirv0203
Jan 11 2018 22:19

hi,

  • right now I am passing hard coded value for my name.
  • I am trying to pass the dynamic username for my name key inside my scriprt tag from sportsService.
  • its working fine in my ts file.
  • but its not working fine in my html file.
  • I am getting an error. ---> Uncaught TypeError: Cannot read property 'marksSession' of undefined
  • can you guys tell me how to pass inside script tag of .html.
  • providing my code below

index.html


    <script>
        (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/APP_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
    </script>

    <script>
        let players=this.sportsService.marksSession();
        console.log("players--->" + players);
        if(players) {
            this.userId = players.user_players.SSO[0];
        }

        Intercom('trackEvent', 'share-link');

        window.intercomSettings = {
            app_id: 'APP_ID',
            name: "Jane Doe", // Full name
            email: "customer@example.com", // Email address
            created_at: 1312182000 // Signup date as a Unix timestamp
        };
    </script>

sports.ts


import { sportsService } from '../../services/sports.service';

constructor(public sportsService : sportsService){

}

ngOnInit() {    

        let that =this;
        let players=this.sportsService.marksSession();
        if(players) {
            this.userId = players.user_players.SSO[0];
        }
}