The biggest thing we take for granted in the current mobile-dominated web is that everything “just works”, no matter what size or type of device you’re on. But what’s the real impact of that expectation?
For customers, the frustration of needing to switch devices can be more than enough to turn them away from a certain product. For product owners, there’s an expectation that everything needs to be created in parallel to be desktop-friendly, tablet-friendly, mobile-friendly, and to have an equal native mobile app for every platform, which can quickly add up in cost. And for developers, there’s the fact that now you have to actually make all those versions of the same app, across completely different technologies for web and native, and have them work similarly enough to not raise any eyebrows.
But luckily, there’s a new way of doing things,…
To start, you can add a file called “jsconfig.json” to the root of your project. You’ll need to add some compiler options, and set “allowSyntheticDefaultImports” to true.
This allows the VSCode precompiler to get type information about your variables and functions, presenting you with handy information when you hover over a symbol.
You can get type information about primitives, or even more complex objects.
And your es6 class declarations too!
The synthetic type inference is smart and can…
In Angular, it’s very easy for a directive to call into a controller. Working in the other direction – that is, calling a directive function from the controller – is not quite as intuitive. In this blog post, I’ll show you an easy way for your controllers to call functions defined in your directives.
First, calling a controller function from a directive is straightforward. You simply define a “callback” function in the controller and pass it to the directive (using the ‘&’ symbol in the isolated scope definition). It’s then trivial for the directive to invoke the function, which calls into the controller. To put things in .NET terms, this is akin to a user control (the directive) raising an event, which the user control’s host (the controller) can handle.
For example, you may want your directive to call your controller when the…
I’m currently working on a solution that exposes a BizTalk Orchestration as a RESTful webservice using WCF-WebHttp. Upon successful processing of the message, the service returns binary data for the client to download. However, if the processing fails, I wanted the service to return application/json data with an error message that would be suitable for consumers – I did not want Stack Traces or other internal details to be provided that could potentially be used by malicious consumers. Further, I wanted to ensure this information was sent in the same session.
Initially, I created a schema with my sanitized error information, set the Fault Operation Message Message Type to that schema, and enabled “Include exception details in faults.” While this did end up including my custom error message, it also included the extra information I was trying to avoid. It also…
While working on my most recent project using the Kendo UI Library I came across the following error when trying to inject html from a partial view into a Kendo UI Window.
SCRIPT5007: Unable to get property ‘top’ of undefined or null reference kendo.all.min.js, line 26 character 30328
This error would only occur in IE8 and not IE10, Chrome, or Mozilla.
var imgArrow = <asp:Literal runat=”server” Text=”<%$SPUrl:~sitecollection/
Style Library/Custom/images/stockup.png%>” />;
While I had originally thought this was a kludgey solution to begin with, it was getting the job done every single time.
However, a problem arose a few days after when I began refactoring the code. I had moved all of the js code from the master page itself into a separate js file, leaving only a static reference to the script on the master. The following code should be put within the ScriptManager control.
Let’s say you have a webpage where you need to call a service but cannot perform a post back. Recently I was on a client engagement where we needed to improve page performance by dynamically loading a navigation tree with a potential for several thousand links. We implemented a solution that would load each branch as the user clicked on the expanding icon by calling a web service via ajax and passing the required links back to the page and render them client side. This saved immensely on the load time for the page and improved the user experience
This kind of solution can be applied to several situations such as complex data processing, dynamic loading, or combining them all into a seamless form submission process that would clear the form on post backs.
We can accomplish this process simply by grabbing…