Generic type alias for a Content representation. It's possible that a content of this type has not been saved yet to the Repository.
Generic type alias for a saved Content representation. Saved contents have an Id, Path and a Name property
Typeguard that determines if the specified Object is a Content instance
The object that needs to be checked
Typeguard that determines if the specified Object is a DeferredObject
The object that needs to be checked
Typeguard that determines if the specified Object is an IContentOptions instance
The object that needs to be checked
Typeguard that determines if the specified Object is an IContentOptions array
The object that needs to be checked
Typeguard that determines if the specified Content instance is saved.
The content that needs to be checked
Generated using TypeDoc
Top level base type of sense NET's Type hierarchy. Content has the basic properties and functionality that can be reached on all of the inherited types. It's almost the same as an abstract class, it may not be instantiated directly, but it has the basic methods implemented that can be called on obejcts with derived types. Unlike other Content Types it is not autogenerated. Content has the basic properties and functionality that can be reached on all of the inherited types. It's almost the same as an abstract class, it may not be instantiated directly, but it has the basic methods implemented that can be called on obejcts with derived types.
See the Pen @sensenet/sn-client-js/content by gallayl (@gallayl) on CodePen.
Unlike other Content Types it is not autogenerated.
Actions
Built-in SenseNet Actions on client-side are methods on the Content object. If you want to use them you have to have a Content which can be made with the Create method that can convert your js Object or JSON with the proper parameters to a Content with the given type.
var content = Content.Create('Folder', {DisplayName: 'My folder'});
On a Content object the Actions can be called like this way (check below sections for further information about the Actions and their params):
let contentDelete = content.Delete(false);
This function returns an Observable so that you can subscribe to it in your code. This way you can work with the response easier defining the three functions of a subscribtion and using all the super helpful and usable features like filtering, combining, caching, etc.
contentDelete.subscribe({ .map(response => response.d) //map and use the reponse's 'd' object as the response .subscribe({ next: response => console.log(response), //if the request was successful error: error => console.error('something wrong occurred: ' + error), //if the request failed complete: () => console.log('done'), //if the request is done }) });
Using RxJS you are able to merge, zip or combine multiple Observables, this way you can develope various combinations of Actions with custom functionality.
Read more about RxJS here
And about Reactive Programming here it could be helpful not only with ajax request but also with event handling or anything else related to async data streams.