<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[IONIC HELP]]></title><description><![CDATA[<p dir="auto">Ionic වල පොඩි දෙයක් දැනගන්න ඕන.</p>
<ol>
<li>Storage eke තියෙන ඩේටා ටිකක් API එකට pass කරලා. API response එකෙ එන ඩේටා ඇප් එකේ පාවිච්චි කරන්න ඕන. මම මේ පහල විදියට කරලා තියෙනවා. ඒ ක්‍රමය හරිද? එහෙමත් නැත්තම් ඒකෙ ගැටලු එන්න පුලුවන්ද කියන එක දැනගන්න ඕනි.</li>
</ol>
<pre><code>//  ex.service.ts
async getOrdersStorage() {
    const data = await this.storageService.get('access_token');
    const headers = new HttpHeaders({
      Authorization: `${data.token_type} ${data.access_token}`
    });
    return this.http.get(`${environment.apiUrl}/rider/pending/${data.business_id}/${data.user_id}`, { headers: headers });
  }
</code></pre>
<pre><code>//ex.page.ts
this.orderService.getOrdersStorage().then(response =&gt; {
      response.subscribe(res =&gt; {
        console.log(res);
      });
    });
</code></pre>
<ol start="2">
<li>මම මේක ටැබ් ලේඅවුට් එකෙන් කරගෙන යන්නේ. යූසර් කෙනෙක් ලොග් වෙලා පලවෙනි ටැබ් එකට එනකොට උඩ තියෙන ෆන්ක්ශන් එක වැඩ කරන්න ඕන.  ඒ එන ඩේටා විව් එකේ ඩිස්ප්ලේ වෙන්න ඔනා. ටැබ් මාරු වෙනකොට රීෆ්‍රෙශ් වෙන්න අවශ්‍ය නෑ.  මෙකට වඩාත් සුදුසු ක්‍රමය මොකක්ද?</li>
</ol>
<pre><code>ngOnInit() {
     this.samplefn();
  }

ionViewWillEnter() {
     this.samplefn();
  }

ionViewDidEnter() {
     this.samplefn();
  }
</code></pre>
<p dir="auto">ස්තූතියි.</p>
]]></description><link>https://lankadevelopers.lk/topic/574/ionic-help</link><generator>RSS for Node</generator><lastBuildDate>Sat, 17 Oct 2026 12:41:06 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/574.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Apr 2020 13:33:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to IONIC HELP on Fri, 01 May 2020 17:49:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Thanks bro :+1: :+1:</p>
]]></description><link>https://lankadevelopers.lk/post/3352</link><guid isPermaLink="true">https://lankadevelopers.lk/post/3352</guid><dc:creator><![CDATA[oditha]]></dc:creator><pubDate>Fri, 01 May 2020 17:49:10 GMT</pubDate></item><item><title><![CDATA[Reply to IONIC HELP on Fri, 01 May 2020 17:07:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/115">@oditha</a></p>
<p dir="auto">Asynchronous functions ගොඩක් කරදරයි use  කරන්න මොකද  ඔයාට බලන් ඉන්න වෙනවා function එක ඉවරවෙනකම් අනිත් function එක run කරන්න , Promise එකක stages 3ක් තියෙනවා මේකෙදි ඔයාට errors handle කරන්න පුළුවන් ගොඩක් ලේසියෙන් ඔයා දැන් use කරන method  එකට වඩා, මේ error  handling  එක ගොඩක්ම සමානයි  synchronous try/catch එකකට මේක ගැන  වැඩි විස්තර දැනගන්න Javascript Promise ගැන කියවන්න.</p>
<p dir="auto">ඔයාගේ මේ process එකට හරියන්නේ Promise එකක් එත් හැම එකටම Promise use කරන්නත් බැ. Async/Await use කරන්න ඕනෙම වෙලාවලුත් තියෙනවා</p>
]]></description><link>https://lankadevelopers.lk/post/3351</link><guid isPermaLink="true">https://lankadevelopers.lk/post/3351</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Fri, 01 May 2020 17:07:33 GMT</pubDate></item><item><title><![CDATA[Reply to IONIC HELP on Fri, 01 May 2020 16:32:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Thanks brother. Me widiyta karamen thiyena advantage eka mokkda? puluwan nm ekat poddak wisthara karanna puluwanda?</p>
]]></description><link>https://lankadevelopers.lk/post/3350</link><guid isPermaLink="true">https://lankadevelopers.lk/post/3350</guid><dc:creator><![CDATA[oditha]]></dc:creator><pubDate>Fri, 01 May 2020 16:32:22 GMT</pubDate></item><item><title><![CDATA[Reply to IONIC HELP on Fri, 01 May 2020 15:06:09 GMT]]></title><description><![CDATA[<p dir="auto">මචන් මේ service  එකේ තියෙන http  request එක promise එකක් විදියට දාන්න</p>
<pre><code>getOrdersStorage(){
    const data = await this.storageService.get('access_token');
    const headers = new HttpHeaders({
      Authorization: `${data.token_type} ${data.access_token}`
    });
    return new Promise(resolve =&gt; {
      this.http.get(`${environment.apiUrl}/rider/pending/${data.business_id}/${data.user_id}`, { headers: headers })
      .subscribe(
        data =&gt; {resolve(data)},
        error=&gt; {
          console.log(error );
        }
      )
    })
  }
</code></pre>
<p dir="auto">Page  එක  ඇතුලේ</p>
<pre><code>this.orderService.getOrdersStorage()
      .then(
        data =&gt; this.handleSuccess(data)
      ).catch(()=&gt;{
        console.log("catched")
      }
    )
</code></pre>
<pre><code>handleSuccess(data) {
//request success  function එක 
}
</code></pre>
]]></description><link>https://lankadevelopers.lk/post/3349</link><guid isPermaLink="true">https://lankadevelopers.lk/post/3349</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Fri, 01 May 2020 15:06:09 GMT</pubDate></item><item><title><![CDATA[Reply to IONIC HELP on Thu, 30 Apr 2020 17:47:55 GMT]]></title><description><![CDATA[<p dir="auto">ionic nam eting me denna tama <a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a>  <a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/2">@dev_lak</a></p>
]]></description><link>https://lankadevelopers.lk/post/3344</link><guid isPermaLink="true">https://lankadevelopers.lk/post/3344</guid><dc:creator><![CDATA[Nubelle]]></dc:creator><pubDate>Thu, 30 Apr 2020 17:47:55 GMT</pubDate></item></channel></rss>