I found there are a couple of examples on ui/chrome, but I am a little confused why the RootController function has different paramter list in different examples, and how the paramters get passed to the RootController. Thanks!
Example 1: The RootController function has 3 parameters ($http, buildNum, buildSha). I don't know who passes the parameters to this RootController?
const chrome = require('ui/chrome')
.setRootTemplate(require('plugins/status_page/status_page.html'))
.setRootController('ui', function ($http, buildNum, buildSha) {
......
}
Example 2: The RootController function has no parameter at all.
require('ui/chrome')
.setRootTemplate(require('./index.html'))
.setRootController(function () {
......
}