-
-
Save etobi/167fbc80875e539fa333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('TYPO3/CMS/StagedealFoobar/Components/Foobar', ['jquery', 'jquery-ui'], function ($) { | |
return function (options) { | |
var settings = $.extend({ | |
foobar: 'defaultwert von foobar' | |
}, options); | |
alert(settings.foobar); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(['jquery', 'TYPO3/CMS/StagedealFoobar/Components/Foobar'], function($, baz) { | |
baz({foobar:'überschreibt den defaultwert von foobar'}); // ruft die function auf, die in dem define zurückgegeben wird. | |
// hier hast du auch jQuery mit $ verfügbar. | |
// "jQuery(document).ready(function(){" brauchst du hier nicht machen | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment