Background
We are using the "Apply with Linkedin" plugin
http://developer.linkedin.com/apply-linkedin
http://developer.linkedin.com/apply-getting-started
This plugin creates a button on our site which allows user to connect to their LinkedIn profile and automate an application process resulting in their profile being sent to us
Problem
When we navigate to the angular view where the LinkedIn button is meant to appear, the button does not show until the page is manually refreshed by the user.
We believe the problem is created by the fact that the code which loads the Linkedin library MUST be maintained in index.html in order to work (see below). However, when this code loads, the view is yet to be populated with the button generator code (as it is only displayed on a downstream view once user navigates). Therefore in order to render the button we must refresh the index.html to re-run the library code and create the button
Implementation of Code
We are using the following code:
1. This code loads the library and is placed in the index.html (as angular will not process if placed in the view)
<script type="text/javascript" src="http://platform.linkedin.com/in.js"> api_key: xxxxxxxxxxx </script>
2. This code generates the actual button in the chosen view:
<script type="IN/Apply" data-companyId="2781471" data-jobId="{{jobid}}" data-meta="source:1,site:2" data-jobTitle="Though developer 25BR" data-url="http://alpha.mindsmeet.com/api/v1/auth/applicant_data/" data-urlFormat="xml" data-onsuccess="myOnclickFunction" > </script>
Potential Solutions
1. We need a way to be able to run the library plug code at the same time when the view loads
a. Ideally run the entire code in the controller (i.e. when user navigates to view - controller code is invoked, causing button to be rendered) - , this will also solve a secondary issue we have where we'd like to manipulate our angular functions with the "data-onsuccess@ [see above] - however controller does not run script tags
b. run the entire code in the view itself - however angular does not allow this and overwrites the script tag
Any help appreciated