Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Owen Melbourne
    @OwenMelbz
    each page can run its own code
    so ionic would say - put your code to change the values in the page
    sounds like it might be more suited to a stackoverflow question - giving example code, showing what you're trying to include then somebody can give exact reply
    Fares tayari
    @farestayari
    ok thank you very much
    but i have another question
    UncertaintyP
    @UncertaintyP
    Why don't you use Ionic from/buttons for this?
    Fares tayari
    @farestayari
    how ? can you explain more please ?
    Fares tayari
    @farestayari
    the other question is , in the app i'm making , there is menu hidden in the header and it's accessible only when i pull down or click to button
    just like the notification bar in a android/ios smartphone
    Fares tayari
    @farestayari
    any help with that ?
    Owen Melbourne
    @OwenMelbz
    i think if it requires more than a sentence to answer - then it needs to be on stack overflow really, the chat is really for quick things
    Fares tayari
    @farestayari
    okay
    thanks you very much ;)
    LalitKushwah
    @LalitKushwah

    How to manage application and page level context in ionic?
    I have researched and found following things:

    Application level Context
    Use localStorage/sessionStorage to avail the things in the whole application.

    Page Level Context
    Use life cycles hook to manage variable scoping and other things of the page level.

    I am worried about memory leak problem in the application. So how to deal with this problem? Is ionic handle this problem or I have to take care of this.

    UncertaintyP
    @UncertaintyP
    What do you mean, what should be leaked at what point?
    Owen Melbourne
    @OwenMelbz
    remember it's just a webpage - so it would have no differences to if the application was running in chrome or safari
    ionic is just library of components with a CLI really
    Menencia
    @Menencia
    Hi! When using ion-input, if the input contains no value and is empty, a border-bottom line appears. How can I remove it ?
    $text-input-highlight-color-valid & $text-input-highlight-color-invalid are not enough...
    nerkartushar8
    @nerkartushar8
    Hi guys, how can I use IonicStorageModule in lazily loaded pages.
    Please help
    Ghost
    @ghost~58a45227d73408ce4f4a8666
    Hi guys, why my method did not work. It returns subscription, but I want to return string. How to make it work?
    public translateValue(key: string): string {
        return this.translate.get(key).subscribe((res: string) => {
          return res;
        });
      }
    it says type 'Subscription' is not assignable to type 'string'
    Zurie
    @zurie
    because you subscribed to it and returned the subscription
    if you want a string out of the subscription, the subscription contains a value which is the string you are looking for
    look inside res and you will see it
    Ghost
    @ghost~58a45227d73408ce4f4a8666
    res is the value itself
    I have also tried this but it don't work
    Zurie
    @zurie
    take the string off and then see wht res gives you
    Ghost
    @ghost~58a45227d73408ce4f4a8666
      public translateValue(key: string): string {
        let result: string;
        this.translate.get(key).subscribe((res: string) => {
          result = res;
        });
        return result;
      }
    Zurie
    @zurie
    is this a pipe
    Ghost
    @ghost~58a45227d73408ce4f4a8666
    It shows that result is not defined
    Zurie
    @zurie
    or is this a function
    Ghost
    @ghost~58a45227d73408ce4f4a8666
    it is a function
    Zurie
    @zurie
    i did this subscribe
     updateUser(value): void {
        this.loading.present();
        this.fab.updateUser(this.navParams.get('myUser').CustomerID, value)
          .subscribe(
          res => {
            console.log(res);
            this.loadUser('email', this.fab.fab_user);
          },
          err => {
            // Log errors if any
            console.log(err);
          });
      }
    Owen Melbourne
    @OwenMelbz
    thats not how it works
    subscribe is like then - its an async function
    you cant return a value from it
    you'd have to do something like
    this.translateValue('something').then(result => console.log(result));
    or similar to @zurie
    but yeah you cant return a value from a async function such as subscribe
    you CAN assign in the callbacks (like zurie)
    Zurie
    @zurie
    loadHistory(id) {
    
        this.fab.getHistory(id)
          .subscribe(
            res => {
              // debugger;
    
              this.profile.history = res ,
                this.loading.dismiss(),
                this.queried = true;
            },
            err => {
              // Log errors if any
              console.log(err);
            });
      }
    <div class="invoice-wrapper"
             *ngFor="let invoice of this.profile.history |  orderBy : '-' | search: myProgress; let i=index"
             [ngClass]="{active: isLevel1Shown('idx'+i)}">
    makes it really hard to understand out of context
    but basically its not like json of the past where you just get data and return key values
    its like now you are subscribing to a stream