Initializing to a Units View(Angular)

I want to initialize(default) the scheduler to a Units view, but when I do this:

scheduler.setCurrentView(null, view);

in either ngOnInit or ngAfterViewInit it throws an error. It does switch to the units view. Works fine for day, week or month with no error. The error:

Error: site view is not defined.
Please check parameters you pass to scheduler.init or scheduler.setCurrentView in your code and ensure you’ve imported appropriate extensions.
Related docs: Views Scheduler Docs

at e3.render_view_data (event.js:223:1)


Hello @Larry,

The described issue could have occurred if you didn’t enable the Units plugin, like follows:

    units: true

Kind regards,

Units are enabled. They work fine unless I try to set the Unit view as the default.


Hello @Larry,

Thank you for the clarification, if you want to initialize scheduler with some view(for example Units), you should use the init method, like follows:


scheduler.init("scheduler_here",new Date(2020, 5, 29),"unit");


You also should be able to set the units view after scheduler loading with the setCurrentView method, like follows:

scheduler.init("scheduler_here",new Date(2020, 5, 29),"week");


scheduler.setCurrentView(null, "unit"); 

But it’s suggested to pass Date as first parameter.

Here is a demo:

If it doesn’t work in your case, it’s hard to suppose what goes wrong in your case without more details, so could you please reproduce the issue in the following snippet:
(open the snippet => reproduce the issue => click the “Save” button => post here the new link)?

Or send me a simplified demo with all necessary files and run instructions, that I will be able to run on my side and check out what exactly goes wrong.

Kind regards,

Thanks, that worked