Visualforce ページで使用される Lightning コンポーネント c:accountList への依存関係を宣言するには、どの Lightning コードセグメントを作成する必要がありますか?
正解:C
The correct answer is option C. The Lightning code segment that should be written to declare dependencies on a Lightning component, c:accountList, that is used in a Visualforce page is:
<ltng:require scripts="{!$Resource.jsLibraries + '/jsLibOne.js'}" afterScriptsLoaded="{!c.scriptsLoaded}" /> This code segment uses the ltng:require tag, which is a base Lightning component that allows you to load external JavaScript libraries and stylesheets in your Lightning components. The scripts attribute specifies the name and path of the JavaScript file that is uploaded as a static resource. The afterScriptsLoaded attribute specifies the name of the client-side controller action that is called after the scripts are loaded. This way, you can ensure that the c:accountList component has access to the JavaScript library that it depends on.
The other options are not valid code segments for declaring dependencies on a Lightning component. Option A uses the ltng:dependency tag, which is used to declare dependencies between Lightning components, not between a Lightning component and a JavaScript library. Option B uses the ltng:include tag, which is not a valid tag in the Lightning component framework. Option D uses the ltng:import tag, which is also not a valid tag in the Lightning component framework.
References: ltng:require - documentation, Using External JavaScript Libraries, Prepare for Your Salesforce Platform Developer I Credential