admin_enqueue_scripts specific page
add_action('admin_menu', function () {
$settingsPage = add_options_page('Settings', 'Mortgage Calculator', 'manage_options', 'mortgagecalculator', function () {
echo "<div id='app'></div>";
});
/**
* Include the ember admin scripts only on pages where it's needed.
*/
add_action("admin_enqueue_scripts", function ($hook) use ($settingsPage){
if($hook !== $settingsPage){
return;
}
// Remove default jQuery since Ember provides its own.
wp_dequeue_script('jquery');
wp_enqueue_script('ember-vendor', plugins_url("admin/assets/vendor.js", __FILE__));
wp_enqueue_script('ember-project', plugins_url("admin/assets/mortgage-plugin-ember-admin.js", __FILE__), ['ember-vendor']);
wp_enqueue_script('ember-live-reload', "http://localhost:4200/ember-cli-live-reload.js");
});
});