function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prasad RuwanpathiranaPrasad Ruwanpathirana 

How to add a lightning application in to the Salesforce1 application?

I have added lightning component to salesforce1 application. But is there any way to add a lightning application to S1 app? Because lightning components doesn't allow to add script files. Therefore I can't load scripts files to the lightning component.Is there any solution for this issue?
Best Answer chosen by Prasad Ruwanpathirana
Prasad RuwanpathiranaPrasad Ruwanpathirana
For the moment we cannot add lightning application in to the salesforce1 nevigation menu. But we can load script files in to the lightning component by creating a link or script tags dynamically in the component's controller doInit function as below.
({
doInit : function(component, event, helper) {

    if (typeof require !== "undefined") {
           //
           //
        } else {
            //Create head tag dynamically
            var head = document.getElementsByTagName('head')[0];

            //Create link or script tag dynamically
            var link = document.createElement('link');

            //Add appropriate attributes
            link.href = "/resource/bootstrap"; 
            link.rel = "stylesheet";

            head.appendChild(link);
        } 

},//Delimiter for future code
References : http://blog.enree.co/2014/10/salesforce-lightning-loading-scripts.html